I have trouble mapping a fork through any pinned branch with go.mod that use a project with the /v2 / major version mapping.
I have the following go.mod:
go 1.18
require (
github.com/versent/saml2aws/v2 v2.35.0
)
Notice the module requires the /v2, otherwise it would get v2.17.0+incompatible.
- I forked the project here: https://github.com/marcottedan/saml2aws
- I created a branch
add-aad-entropy-PhoneAppNotificationhere:https://github.com/marcottedan/saml2aws/tree/add-aad-entropy-PhoneAppNotification - I tried to modify, or not, the first line of go.mod in my fork go mod from
module github.com/versent/saml2aws/v2tomodule github.com/marcottedan/saml2aws/v2
I'm using the following directives and none are working:
This downloads the tag 2.35.0 of my fork even though I ask it to get master
dmarcotte@dmarcottes% go get -d github.com/marcottedan/saml2aws/v2@master
go: downloading github.com/marcottedan/saml2aws/v2 v2.35.0
go: github.com/marcottedan/saml2aws/v2@v2.35.0: parsing go.mod:
module declares its path as: github.com/versent/saml2aws/v2
but was required as: github.com/marcottedan/saml2aws/v2
I also tried modifying my go.mod:
replace github.com/versent/saml2aws/v2 => github.com/marcottedan/saml2aws/v2 v2.35.0
-> Can't find a way to target master with the /v2 pattern
If I drop the /v2 and just go with @master, it doesn't care and get the latest tag in v1 (which was named 2.17.0+incompatible before saml2aws migrated to go mod)
dmarcotte@dmarcottes % go get -d github.com/marcottedan/saml2aws@master
go: github.com/marcottedan/saml2aws@master: github.com/marcottedan/saml2aws@v1.8.5-0.20220520001825-f05a14a2b3f2: invalid version: go.mod has post-v1 module path "github.com/marcottedan/saml2aws/v2" at revision f05a14a2b3f2
I'm quite lost here.