3 ms·
The key innovation here is that it uses the URL to do the parameterization. That's not what is implemented in your reference [2]. I think this approach is actu
by barrkel 12y ago
The key innovation here is that it uses the URL to do the parameterization. That's not what is implemented in your reference [2].
I think this approach is actually quite clever. It's clever because URLs belong to a global namespace. If you have third-party code that is also using an instantiated generic, your code should be compatible with it because you'll be using the same URL. Whereas locally-generated templates are more problematic - compatibility depends on build scripts etc.
- timtadh 12y agoI agree this does solve the `go get` problem. However, a better thing would be to improve `go get` and make it use an actual build system. `go generate` is a step in the right direction but they expect you to check the generated sources in. I would prefer a tool chain that allowed your API customers to do code generation from your library. However, these things are more complicated and the Go Author's are probably right to do the simplest thing first.