You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, constant and variable declarations must have an explicit type to be grouped with that type. For example, go/build.Context is declared like var Default Context = defaultContext(), with an explicit Context type, because otherwise Default wouldn't be listed under the Context type.
If you add an explicit type, and the type can be inferred from the right-hand side of the assignment, then golint complains about the redundant explicit type.
If the Context type was missing from the Default declaration, it would be impossible to know for sure what type it is, since defaultContext isn't exported. (Okay, maybe you could guess in this situation, but what if it was called getDefault instead?)
We should instead compute a const/var declaration's type with the type checker and group them in doc accordingly.