5 ms·
it forces the package names to be globally unique, by piggybacking off of DNS. If you own "lclarkmichalek.com" you can put up a server and then have "import lc
by zemo 14y ago
it forces the package names to be globally unique, by piggybacking off of DNS. If you own "lclarkmichalek.com" you can put up a server and then have "import lclarkmichalek.com/foobar/foo" if you really want to.
- lclarkmichalek 14y agoThat's a point I hadn't thought of. Though on the negative side, it does make it significantly harder to create a true "drop in replacement" that other languages have (i.e. where a library provides a replacement of another library without requiring any modification to the source code of an application using that library).
- NateDad 14y agoThat's a good thing.
- lclarkmichalek 14y agoHow so? I can think of a couple of examples where libraries have needed to be replaced and it's only because their replacements were transparently compatible that the replacement was possible without major pain all around.
- chimeracoder 14y agoYou're still going to need to recompile, because Go programs are all statically linked. Replacing the imports is pretty easy, though - because Go is so draconian about certain elements of formatting and style (including restrictions on imports), it's relatively straightforward to migrate code like this. (The 'go fix' tool is an even better example of the power that such an opinionated compiler provides as its tradeoff)