Well, that was going to be my next question (how do I install a module from 
a local git repo or directory).

If I understand you correctly go modules require a remote git repo, even if 
they are used only one machine.  That should be made clear in the docs.

Modules get cached locally in $GOPATH/pkg/mod, but in my module directory 
of I do

    go install lib/conf.reader.go

it completes without errors, but I don't get a binary or source code file 
anywhere under $GOPATH/pkg/mod (or anywhere else I can see).

Does go install work differently with modules?

On Wednesday, March 11, 2020 at 9:22:46 AM UTC-6, Bryan C. Mills wrote:
>
> On Tuesday, March 10, 2020 at 5:47:45 PM UTC-4 dean.w....@gmail.com wrote:
>
>> This blog entry <https://blog.golang.org/publishing-go-modules> uses git 
>> tags.  It didn't mention branches.  Are tags the only way to declare a 
>> version number?
>>
>
> Yes, tags are the way to declare a version.
> Generally branches represent ongoing development: further commits may be 
> added without changing the branch name.
> In contrast, each version of a Go module must refer to one specific, 
> unchanging copy of the code.
> (That is important both for security and for reproducibility.)
>
> Also, what if my git repo is local to my laptop?  I'd think I should still 
>> be able to publish versioned modules to my local GOPATH from my local git 
>> repo.
>>
>  
> See https://golang.org/issue/28835, but in general we do not expect users 
> to need version selection for modules that are not published beyond a 
> single host.
>
> (But note that you can always set up a local HTTP server using the remote 
> import path <https://golang.org/cmd/go/#hdr-Remote_import_paths> protocol, 
> and use a local DNS entry and the GOPRIVATE environment variable to tell 
> the Go command where to find the repo.)
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/2eb95d66-b5e5-4640-a6cc-529189fe38ed%40googlegroups.com.

Reply via email to