News for hackers. Stuff that matters.
Re:How to start a Go project in 2023 by lmm on Tuesday May 23, 2023 @07:14PM (#36052027)
> - Vendoring dependencies using "go mod vendor" is not a good default workflow - it bloats the repo, the checked in code is impossible to review, and is generally a pain to keep up to date. Don't, unless you really have to.

Go's setup is that if you don't vendor your dependencies then your build might break at any time, no?

Re:How to start a Go project in 2023 by metaltyphoon on Tuesday May 23, 2023 @08:11PM (#36052397)
Not if your default $GOPROXY is google. Google will cache that package indefinitely?
Re:How to start a Go project in 2023 by liggitt on Tuesday May 23, 2023 @10:53PM (#36053511)
That's explicitly not guaranteed. From https://proxy.golang.org:

> Why did a previously available module become unavailable in the mirror? > > proxy.golang.org does not save all modules forever. There are a number of reasons for this…

(I am a googler, but don't work on the go team – my opinions that projects should vendor and actually review their dependencies are my own)

Re:How to start a Go project in 2023 by gwd on Wednesday May 24, 2023 @04:43AM (#36055513)
> proxy.golang.org does not save all modules forever. There are a number of reasons for this, but one reason is if proxy.golang.org is not able to detect a suitable license.

If you're vendoring something without an appropriate license, you're skating on thin ice legally.

Re:How to start a Go project in 2023 by liggitt on Wednesday May 24, 2023 @01:44PM (#36061600)
That's just one possible reason. The disclaimer does not specify all the possible reasons the proxy would drop a saved version. Treating it more like a cache seems appropriate.
Re:How to start a Go project in 2023 by hsn915 on Tuesday May 23, 2023 @08:51PM (#36052660)
No, packages are stored locally in a "modcache".

Unless you're doing something stupid like "create a clean virtual environment for every build" then yea your build might break if you lose the internet or the packages disappear. Just don't ever do that stupid thing.

Re:How to start a Go project in 2023 by wizhi on Wednesday May 24, 2023 @06:59AM (#36056291)
This is essentially he default when using most CI services, however.
Re:How to start a Go project in 2023 by hsn915 on Thursday May 25, 2023 @11:44PM (#36079571)
Hence most CI services are stupid