3 ms·
`go vet -shadowstrict` works pretty well for the shadowing problem. Look at go's `net/url` package. The type is `URL` because it's exported, there's no `New` f
by lowmagnet 9y ago
`go vet -shadowstrict` works pretty well for the shadowing problem.
Look at go's `net/url` package. The type is `URL` because it's exported, there's no `New` function. It instead uses the conversational `Parse`.
`url.URL` does stutter, and `url.Parse` probably belongs in the url module, with the type in `net` to reduce stutter.
This would make `net/URL` a clearer non-stuttering type. It would also make 'net/url' a library of functions with which `net/URL`s are manipulated and a clean-room fashion.