Hi,

We were using go 1.7 until recently and now want to switch to 1.11 and 
start using go modules.

Currently our source organization is as follows:

~/go/src/gitlab.com/example/
                                   |
                                   |
                                   example/
                                        |
                                        |
                                        |api/
                                        |   |
                                        |   main.go (imports library1, 
library2 and some 3rd party libs)
                                        |library1/
                                        |   |
                                        |   lib1.go
                                        |library2/
                                        |  |
                                        |  lib2.go

In our main.go, We were importing packages like:

```
"gitlab.com/example/example/library1"
"gitlab.com/example/example/library2"
"gitHUB.com/3rdpary/library"
```

We actually wanted to import library1 and library2 via relative path 
("../library[12]") but since the go compiler did not support relative 
imports then, we used the absolute imports. We did not use any dependency 
management tool (like dep, glide etc.).

The libraries that we write (library1 and library2) need not be versioned 
and will always be used in a reliable state in our api/main.go

We however need versioning support for our 3rd party libraries.

For such a hybrid requirement, what is the most recommended way to import 
and structure our libraries and the source directories, to work with go 
modules ? I tried reading through https://github.com/golang/go/wiki/Modules 
but I could not find out any recommended way for this. Any help on how I 
can do this ? Do I need to create `cmd` or `src` folders in our git repo ? 
OR do we need to do something else ? Any links for blogposts, tutorials, 
documentation, videos etc. will be helpful. Thanks.

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to