Menu

Anything wrong with setting version 1 of a module to use "/v1", similarly to versions 2+? Or, releasing version 2 as the actual first version?

#golang#redditgolang#version#scheme#schemes
Reading 0:00
15s threshold

I plan on releasing the first version of my first public Go module in the near future. When I've made Go modules in the past, I always kept them on a private, self-hosted server (rather than, say, github.com).

One of the things that's always bothered me about how Go and Git interact is that (at least under one of the commonly used schemes) when someone looks at a GitHub repository for Go code, unless they know about -- and think to look for, or otherwise notice -- the whole "/v2" kind of scheme, they'll probably at first just see "myawesomething.go" at the top level (or within the top-level "pkg" tree or whatever), and may very well assume that the latest version of that file contains the latest version of "type MyAwesomeThing struct", as opposed to immediately knowing that it contains the latest version of "type MyAwesomeThing struct" for major version 1 of the module .

I'm aware that there are other schemes to deal with this sort of thing, involving branching and/or entirely new repositories.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.