Open universam1 opened 5 years ago
A known issue is that this repo is at V2 and has interesting behaviour with go.mod, so as a fix I made the main branch V2 which I think may affect dep. I would like to rebase it and make master the main branch but I need to merge all the outstanding PRs before this can happen - this should fix this. I would note however that this repo guarantees compatibility with the go module system only so YMMV with dep.
Looks like it is an upstream bug https://github.com/golang/dep/issues/1962, https://github.com/golang/dep/issues/2139
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+). Pre-existing dependency management solutions such as dep currently can have problems consuming a v2+ module created in this way. See for example dep#1962.
https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher
I'm not sure @dillon-giacoppo how modules should work better, I do get following result
"unknown import path \"github.com/atlassian/go-artifactory/artifactory\": cannot find module providing package github.com/atlassian/go-artifactory/artifactory"
Could you please elaborate how this should work as a module?
if I try to forcefully load the latest module I get the following error:
╰─➤ go get github.com/atlassian/go-artifactory@v2.3.0
go: finding github.com/atlassian/go-artifactory v2.3.0
go: github.com/atlassian/go-artifactory@v0.0.0-20190429001105-3369e1c17e23: go.mod has post-v0 module path "github.com/atlassian/go-artifactory/v2" at revision 3369e1c17e23
go: error loading module requirements
I believe your module setup @dillon-giacoppo is broken
If I start from scratch it only resolves up to 1.2.0
go: finding github.com/atlassian/go-artifactory/artifactory latest
go: extracting github.com/atlassian/go-artifactory v1.2.0
Please checkout my previous comment and attached tickets, dep is not compatible with go modules that use tags to do major versioning (single master branch). This is because the pseudo major version in the module path does not correspond to an actual directory. v1 works because it does not go looking for a v1/ directory.
Modules are now the official way to do dependency management so I don't plan on supporting dep.
I understand @dillon-giacoppo your point that dep is not supported but you are using module.
Please see above error message that is related to module usage, not dep
Can you please give steps to reproduce. i.e go version, exact command run etc.
compiled a Dockerfile
for your convenience, run docker build .
FROM golang:1.12
WORKDIR /src
RUN echo 'package main\n\
import "github.com/atlassian/go-artifactory/artifactory"\n\
func main() { artifactory.NewClient(client, nil) }\n' > test.go
RUN go mod init test
# also try this:
# RUN go get github.com/atlassian/go-artifactory@v2.3.0
RUN go build .
Try the commented statement too, see how module is unable to resolve the latest version
You are trying to use a major version >= 2 without adding a v2 to the module path. The correct Dockerfile would be
FROM golang:1.12
WORKDIR /src
RUN echo 'package main\n\
import "github.com/atlassian/go-artifactory/v2/artifactory"\n\
func main() { artifactory.NewClient("", nil) }\n' > test.go
RUN go mod init test
# RUN go get github.com/atlassian/go-artifactory/v2 @v2.3.0
RUN go build .
The examples also have correct usage.
I encountered the same problem, really difficult to use, simply unable to install the latest version of the package, directly give up.
Describe the bug When I try to include this library, dep errors because of malformed code
To Reproduce
Expected behavior to resolve this library
Log Output
Desktop (please complete the following information):