Guys. You’re all asking questions that amount to roughly the same thing, and also (in my opinion) being somewhat rude about it. Just writing a topic title and pasting a blob of code is a very lazy way to post a question, shifting the burden of understanding the question and context onto lots of readers instead of you taking the time to explain. Instead, take the time to explain your problem, show a complete snippet of code that illustrates the problem (preferably on play.golang.org), and provide some example data that is required to run it, etc.
If you’re all in the same class and studying these things, talk to each other. Ask your instructor who is presumably paid to explain.
If this is part of a class assignment to solve problems individually by seeking out resources on the internet you are going about it the wrong way - see above about asking questions properly.
We’re all happy to help, but speaking for just myself this is getting somewhat tiring.
Edit: I see that essentially the same thing was said in another topic, but better expressed. Anyway.