3 ms·
It's quite possible to write a parse method in go such that foo := json.Parse(os.Stdin) would work. I'll acknowledge that it would be extremely unidiomatic
by shanemhansen 12y ago
It's quite possible to write a parse method in go such that
foo := json.Parse(os.Stdin)
would work. I'll acknowledge that it would be extremely unidiomatic to ignore errors and not provide the parse call with type hinting information. A more idiomatic version would look like:
var foo SomeType
err := json.NewDecoder(os.Stdin).Decode(&foo)