News for hackers. Stuff that matters.
Re:How to start a Go project in 2023 by 0zemp2c on Tuesday May 23, 2023 @02:53PM (#36049029)
vendoring is a bit of project smell, but for large teams it removes the confusion of who has what version of a dependency

unfortunately most teams don't schedule a periodic `go mod tidy` so you just end up with ancient deps

most people never read the code of the deps they pull in, so I don't think vendoring provides any security assurances

Re:How to start a Go project in 2023 by icholy on Tuesday May 23, 2023 @03:06PM (#36049198)
That's not what `go mod tidy` does ...
Re:How to start a Go project in 2023 by Paul-Craft on Tuesday May 23, 2023 @04:20PM (#36050316)
I'd go way farther than "a bit of a project smell." I literally cannot think of a single instance in which vendoring a dependency for any reason other than, say, caching it for CI so you don't have to worry that the maintainer pulls a `left-pad` on you, has gone well.

If the package has bugs, you're far better off either waiting for upstream fixes, working around the bug in your application code, or just switching to a different library. That goes double if the library you're using is missing a feature you need, even if it's scheduled for the next version release.

Unless you're prepared to maintain a full-on fork of the dependency (and, if you do, please make it public), everything about vendoring for these reasons is 100% bad for you for very little incremental benefit. It's like the joke about regular expressions ("You have a problem and think 'I'll use regexes to solve it.' Now you have two problems"), except it's not a joke, and it sucks way more.

TL;DR: Vendoring to cache for CI/build servers, yes. Any other reason, just don't; it's not worth the headaches.

Re:How to start a Go project in 2023 by ownagefool on Tuesday May 23, 2023 @05:39PM (#36051174)
If you work on code that introduces threat to life, you might be prepared to own all the code, even if you don't write it all from scratch.
Re:How to start a Go project in 2023 by dilyevsky on Tuesday May 23, 2023 @06:10PM (#36051474)
> it removes the confusion of who has what version of a dependency

go.mod/sum files already remove that confusion as it’s their intended purpose