I am looking for a way to control a go package version on github, something similar to the "version" key in a package.json file (for nodejs packages).
In a package.json
{
"version": "1.0.1"
}
I want to import my package in another one, both use go modules. In my second package, my go.mod file looks like this :
module myPackage
go 1.14
require(
github.com/myAwesomePackage v0.0.0-20200531102207-93175fe4ed5f
)
Now I'd like to make changes to myAwesomePackage, so I can rewrite myPackage mod file like this :
module myPackage
go 1.14
require(
github.com/myAwesomePackage v1.1.0
)
I tried git tag 1.1.0 and git tag v1.1.0 in myAwesomePackage, but
myPackage gives the following error when trying to update :
invalid version: unknown revision v1.1.0
UPDATE
git tag actually worked, the issue seemed to come from my Ide (GoLand). Just rewriting version in go.mod file didn't worked, I had to remove the
entire line in require statement, then let IntelliJ sync again the
dependencies. Now myAwesomePackage is imported with the correct version.