Il giorno martedì 6 aprile 2021 alle 09:47:18 UTC+2 Gergely Födémesi ha 
scritto:

> Hi, 
>
> assuming GO111MODULE=on. 
> I don't want to publish anything, anywhere. 
>
>
If you don't want to publish anything, you can use a reserved domain in 
your module path; as an example:
gergely.localhost, or gergely.local (the latter will require adding the 
host to /etc/hosts).

Beside the main package, I want to put functionality into other new 
> packages as well. 
> Could somebody share the workflow to do _only_ that? 
> Where can I read about the correct incantations? 
>
>
When fetching external modules to resolve your module dependencies, the go 
tool will assume the module path is an URL, fetching the package using the 
network.
One exception is when using the Go module proxy (GOPROXY); here the module 
path is generic URI.

There are 4 solutions for supporting local modules:

1. Using the replace directive in go.mod
2. Using a custom Go Proxy that resolves a Go module to a vcs repository on 
your filesystem.
     I don't know if Athens support local modules.
3. Implement the go get protocol, resolving modules to a vcs repository on 
your filesystem.
    I have a working implementation but currently is not published.
4. Configure git to resolve an HTTP resource to a local filesystem resource:
      go env -w GOPRIVATE="gergely.local"
      git config --global "url.file://$root/gergely.local".insteadOf 
"https://gergely.local";
    where $root is the directory containing the gergely.local directory.
    If your modules are inside GOPATH, then root is $gopath/src

Regards
Manlio

-- 
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/e5ded646-f0fe-4c11-ac59-b94923f9af18n%40googlegroups.com.

Reply via email to