Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
range by slice or map returns two variables, if you don't need the first one, write an underscore there. It means emptiness.
Declared variables, according to the strict rules of Go, must be used (otherwise it will not compile). If this is not necessary (for example, when the function returns two values, and you only need the second), then we replace them with _ and there will be no more errors.
What does it mean in import?
It says https://golang.org/ref/spec#Import_declarations:
An import declaration declares a dependency relation between the importing and imported package. It is illegal for a package to import itself, directly or indirectly, or to directly import a package without referring to any of its exported identifiers. To import a package solely for its side-effects (initialization), use the blank identifier as explicit package name:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question