func main() { flag.Parse() if err := jsongostruct.Convert(os.Stdin, os.Stdout, *name); err != nil { fmt.Print(err) } }
func postHandler(res http.ResponseWriter, req *http.Request) error { defer req.Body.Close() dec := json.NewDecoder(req.Body) var postData PostData if err := dec.Decode(&postData); err == nil { return jsongostruct.Convert(bytes.NewReader(postData.Json), res, postData.Name) } else { return err } }