Thanks for the help, so i think i get it fully now.

@Nick:  Sure works great if you're making a project with github modules. 
Having local modules is possible. But so cumbersome people would be 
occupied with managing files rather than writing code (if you have >20 of 
them).

@Carla: Actually i think the process is convinient now. Thanks for the 
suggestion. Actually tried that before but failed as how it works is little 
misleading because from reading the docs I got an impression that you need 
to keep the go.mod inside app's main package. While module should be 
created one level lower, then you can have local packages shared between 
projects and you're not forced to be bound to your main package for imports.

Not the modules itself but the way of handling the issue or using modules 
most people are suggesting are broken. The docs give impression i should 
convert everything to modules while like @Carla said we should just say 
create /src dir with module called src, put everything there, prefix 
imports with "src" and if some code is stable/mature enough you could 
publish it by converting to a "proper", hosted module later.

Not sure why almost everyone is mentioning local proxies, replace or some 
other complex stuff and documentation is so complex, when you can just do 
it like that. Was sitting on this module stuff and docs for it for 3 days, 
probably more than 15h just to realize this is so simple and i was going in 
totally wrong direction.


czwartek, 8 kwietnia 2021 o 16:22:56 UTC+2 m8il...@gmail.com napisał(a):

> > >>One solution is apparently to use a module like a giant mono repo, aka 
> gopath>
> Still it requires for this replace
>
> You do not need replace, unless you are amalgamating multiple modules.
>
> You can just create a folder named e.g. library with a .go file; package 
> lib
>
> Then in your other folders with package main, .go files:
>
> You can
>
> import (
> lib "{moduleName}"/library
> )
>

-- 
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/81bc87fc-5c02-4d4f-ae2d-6fc6da7607f3n%40googlegroups.com.

Reply via email to