Help understanding this

gopher-go-file-to-be-parsed

I don’t understand what this code does… it was in the GolangUK Conference '17

What I’ve understood:
The constant “GOPHER” string is fed into the gogopher, which is an instance of Gopher()…

What does the &Gopher{Gopher : “gopher”} do?
What is the purpose of json:"gopher" string?

Any insight is much appreciated/

Take a look at A Tour of Go.

See Go by Example: JSON

2 Likes

Thank you!
One more follow up:
Can I call the file containing parser.ParseFile on itself?

You call ParseFile on a filename. This can of course be the filename of the .go source of the current program.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.