6 ms·
That's incorrect. The go blog recommends copying your entire project into a v2 folder. They do suggest you can use tags/branches instead, but it will cause prob
by nvarsj 5y ago
That's incorrect. The go blog recommends copying your entire project into a v2 folder. They do suggest you can use tags/branches instead, but it will cause problems with GOPATH projects.
- deleted 5y ago[deleted]
- atombender 5y agoIt recommends this, sure, but there's no need for it. Doing so would be purely for backwards compatibility with older versions of Go tools that don't understand modules and rely on GOPATH. If you don't need to support older tools, then there's absolutely no need to copy anything.
- ruraljuror 5y agoMaybe I'm missing something, but I think there is a need. If your code imports dependencies A & B and they depend on C at two different versions, how can you handle this unless C is structured with versioned dirs?
- atombender 5y agoGo does not map the module path directly to a file system path. You can import v1 and v2 at the same time because they have different module names. In other words, this is allowed: $ go get github.com/linkedin/goavro@v1.0.5 $ go get github.com/linkedin/goavro/v2@v2.10.1 Then: $ go list -m ... | grep goavro github.com/linkedin/goavro v1.0.5 github.com/linkedin/goavro/v2 v2.10.1 Version 1 has a go.mod that declares: module github.com/linkedin/goavro and version 2 has a go.mod that declares: module github.com/linkedin/goavro/v2 but both have their Go files located in the root of the repository.
- arghwhat 5y agoGOPATH is luckily soon dead.
- throwaway894345 5y agoWhich is kind of remarkable. Python still seems to try to support every package manager and format that ever existed, and that’s part of why packaging in Python is so awful. Nice to see a language that can move forward with such a major change in such a short time and with relatively little pain.
- btmcnellis 5y agoPython is a lot older and a lot more widely used, so it’s not as easy to just change things.
- eikenberry 5y agoPython3 is pretty close to Go in age and was a purposely compatibility breaking, so it could have easily changed things at that point and they definitely knew about the problem at that point.
- mkl95 5y agoThe difference between 2 and 3 is way smaller than people make it out to be. I migrated a large Python 2.7 project to Python 3.8 and it wasn't a particularly painful experience. I feel that way more effort should have been directed at making 2 and 3 compatible.
- throwaway894345 5y agoIt took more than a decade for the ecosystem to migrate. IIRC, a lot of effort went into making them compatible, but some things are just fundamentally incompatible and also very difficult to automate (e.g., string encodings).
- mkl95 5y agoI learnt Python in 2013, when Python 3 still had some serious growing pains. I switched from 2 to 3 almost overnight circa 2015 or 2016. The last few years I cannot help but feel they were very close to making 2 and 3 play nice together, but the idea ironically lost traction because of how much Python 3 adoption had accelerated.