|
|
|
|
|
by dmitriid
1914 days ago
|
|
> Sorry to hurt your feelings, but it is not. The _compiler_ cannot know whether the code in a package might be used I'm sorry to hurt your feelings, but compiler definitely can know whether some external module is used in the file it's compiling now. See my other comment: https://news.ycombinator.com/item?id=26553401 |
|
Without opening more files and parsing them, how does it know that none of the transitive dependency tree has a `func init(){}` ?
Go forces you to add an underscore if you mean "I'm importing this for its side-effects, and am not using it directly".