educative.io

Error in json Unmarshal because of multi line json string

There is an error in the Decoding with JSON - The Way to Go paragraph, because the json should not be written on multiple lines (if you write err := json.Unmarshal(b, &f) you will find that it throws an error invalid character '\n' in string literal).

The entire json string should be put on a single line.