pantheon-systems / autotag

Git repository version tagging tool
http://godoc.org/github.com/pantheon-systems/autotag
Apache License 2.0
192 stars 43 forks source link

autotag is currently not go-gettable #48

Closed davidovich closed 3 years ago

davidovich commented 3 years ago

Hi,

Currently, If I do a go get github.com/pantheon-systems/autotag/autotag it will fail with this message:

go: found github.com/pantheon-systems/autotag/autotag in github.com/pantheon-systems/autotag v1.3.6
go get: github.com/pantheon-systems/autotag@v1.3.6 requires
        github.com/Unknwon/com@v0.0.0-20190804042917-757f69c95f3e: parsing go.mod:
        module declares its path as: github.com/unknwon/com
                but was required as: github.com/Unknwon/com

This is because replace directives are not honored by go get, and they will probably never will.

Removing the replace directive gives this error:

david$ go mod tidy
go: github.com/Unknwon/com@v0.0.0-20190804042917-757f69c95f3e: parsing go.mod:
        module declares its path as: github.com/unknwon/com
                but was required as: github.com/Unknwon/com

And this is caused by an old version of git-module which requires package github.com/Unknwon/com with an uppercase U.

go: finding module for package github.com/Unknwon/com
go: found github.com/Unknwon/com in github.com/Unknwon/com v1.0.1
go: github.com/pantheon-systems/autotag imports
        github.com/gogits/git-module imports
        github.com/Unknwon/com: github.com/Unknwon/com@v1.0.1: parsing go.mod:
        module declares its path as: github.com/unknwon/com
                but was required as: github.com/Unknwon/com

If interested, I have a small PR that brings the github.com/gogs/git-module (formerly github.com/gogits/git-module) to v0.8.3 and removes the need for a replace directive.

vtopc commented 3 years ago

Looks like it should be moved from github.com/pantheon-systems/autotag/autotag to github.com/pantheon-systems/autotag/cmd/autotag first of all.

davidovich commented 3 years ago

@vtopc I believe that directory structure decisions are orthogonal to the dependency problem described in this issue, it is not required to have a cmd directory if you know that you will ever have only one binary for the repository. Even if you move to cmd, with the current set of dependencies, you will still get a failure.

If moving things is an option, I would even favor a root directory main.go so go get github.com/pantheon-systems/autotag would install the binary.