How to make a module use master branch for a package

(Suppandi G) #1


I have a go module that imports project foo. foo’s latest tag says v1.4

when i do a go build in my project, it updates go.mod to say


require ( v1.4

I want it to use the master branch instead of v1.4 tag…so i did a go get and it downloaded the master branch in pkg and updated go.mod to say

require ( v1-XXXXXXX-XXXXXXX

I verify that the hash is the same as master

but when i do go build again, it gets updated back to the latest tag.

how do i get it to use the master branch and not switch back to v1.4?


(Boban Acimovic) #2

Just type master after the repo name (instead of v…) in go.mod.

(system) closed #3

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.