inkyblackness/imgui-go

v2.0.0 can not be imported

Closed this issue · 4 comments

Well, trying to do a proper v2 upgrade did not work out as intended.

Trying to upgrade imgui-go-examples to use v2.0.0 brings this error:

require github.com/inkyblackness/imgui-go: version "v2.0.0" invalid: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2

Trying to figure out what is intended.

OK, seems like using tags alone is not as they intended.
Looking at this here: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher it seems that either a v2 branch, or a v2 subdirectory is required.
Subdirectory will not be possible, as this compiles too much C++ . (next to probably creating name clashes).
So, most likely I'll have to rename "master" to "v2" and "master-1.x.x" back to master again.

Correction: the section about a separate branch specifically describes the option for just using tags on master:

Note: creating a new branch is not required. If instead you have been previously releasing on master and would prefer to tag v3.0.0 on master, that is a viable option. (However, be aware that introducing an incompatible API change in master can cause issues for non-modules users who issue a go get -u given the go tool is not aware of semver prior to Go 1.11 or when module mode is not enabled in Go 1.11+).

So, what's wrong?

Possibly the fact that the module name must include a /v2 -- going to try this.

Yup, that was it. I learned something new.
The examples project can compile and run now.