Example #1
0
File: main.go Project: ZBNA/deploy
func main() {
	if flag.NArg() != 0 {
		flag.Usage()
	}

	var tmp interface{}
	if err := json.NewDecoder(os.Stdin).Decode(&tmp); err != nil {
		log.Fatalf("Error decoding JSON: %s", err)
	}

	tomlData := translate(tmp)
	if err := toml.NewEncoder(os.Stdout).Encode(tomlData); err != nil {
		log.Fatalf("Error encoding TOML: %s", err)
	}
}
Example #2
0
func (t *tomlConfigEncoder) Encode(w io.Writer, c *Config) error {
	enc := toml.NewEncoder(w)
	return enc.Encode(c)
}