3 ms·
you can already do this in other languages. For example, here is Go: package main import ( "encoding/json" "encoding/xml" "os
by 38 3y ago
you can already do this in other languages. For example, here is Go:
package main
import (
"encoding/json"
"encoding/xml"
"os"
)
type wc struct {
File []file
}
type file struct {
Lines int
Words int
Characters int
Filename string
}
func main() {
etc_motd := wc{
[]file{
{25, 1165, 1140, "/etc/motd"},
},
}
json.NewEncoder(os.Stdout).Encode(etc_motd)
xml.NewEncoder(os.Stdout).Encode(etc_motd)
}
- paulddraper 3y agoGee thanks mister!
- 38 3y agoget outta here kid.