4 ms·
> there's no way to import both the v1 and v2 APIs at the same time in your code, so you don't have a way to declare a conversion function. In Go major version
by mseepgood 4y ago
> there's no way to import both the v1 and v2 APIs at the same time in your code, so you don't have a way to declare a conversion function.
In Go major versions have different import paths. You can import multiple major versions of the same library:
import (
http_server_old "example.com/http_server"
http_server_new "example.com/http_server/v2"
)
- jmillikin 4y agoSure, but that's not what's being discussed here. In C and C++, it's idiomatic to have different major versions use the same includeable name, with the version resolution handled by the build system.
- staunton 4y ago... where "build system" means a bunch of preprocessor macros, at which point you just use the oldest version of everything available and never update anything that works.