Richard Bucker

golang required import foo

Posted at — Apr 27, 2015

I was working with a 3rd party library that insisted that I import a particular dependency. The problem was that the package was NEVER referenced. ┬áIt turned out that there is a bit of FOO in the package declaration:package osext // import “github.com/kardianos/osext”That comment at the end of the line tell the compiler to do something. Here is an odd place to put this doc but I think it reflects the intent as it may be the official proposal. At least it seems to work this way.