Comments (7)
This go module hell is real people!
from project-layout.
Switching from dep to go modules is pretty easy @rhugga
first activate go mod if not active
$ export GO111MODULE=on
to switch from dep to go mod
$ go mod -init
$ go build ./...
$ rm -rf vendor Gopkg.* # look ma no hands
$ go list -m all
so go build ./...
will fetch your dependencies and add them to go.mod
and go.sum
.
a nice wiki https://github.com/golang/go/wiki/Modules#daily-workflow
i already have two apps under my profile but i guess there is a lot of apps started to switch to go mod since dep not maintained anymore
from project-layout.
I have wondered this as well. Where do go.mod and go.sum end up in a complex project?
from project-layout.
@williamh still no answers?
from project-layout.
@williamh typically go.mod and go.sum should be in the project root. kubernetes is one example.
from project-layout.
I also have to anchor it with a .MODULE_ROOT file in the project root and have a GetModuleRootPath()
function in the root package that knows how to search and find the root project path in order to find assets required for the unit-tests. Need to set a variable for it in Travis CI config. Have been unable to find any other way (since all of the projects flatten into executables and there is only a limited concept of a tree at the end).
from project-layout.
The Kubernetes Go client is a good example of the go module versioning hell: so far, the Kubernetes go client module maps all stable versions vx.y.z
since 1.17.z onto v0.y.z
, such as v0.17.0
. Until go module versioning starts working in the Kubernetes client, I personally consider this versioning concept to be unready for real-world consumption and only a non-proof of concept.
And that's probably the reason for the mass of rather useless trivial blog posts that just repeat one after another the same useless examples (there is a nice German proverb fitting perfectly the blogosphere: "albeit everything has been said, it hasn't yet been said by everybody").
from project-layout.
Related Issues (20)
- This organization should be renamed with a note in the README HOT 5
- Any references for `/init` pattern?
- singular? plural? HOT 3
- Duplicated simplified-chinese translated README HOT 1
- Guidance could be provided on where to put tests in library directories HOT 1
- Driver location
- Why there is no link to the Italian translations? HOT 1
- The release badge is broken
- Minio no longer uses /pkg in the project layout HOT 2
- How can I debug projects with this structure in VSCODE? HOT 2
- Question: best place to put "local environment" startup scripts ? (not Helm) HOT 1
- Why are some directories plural and others singular? Can it be unified?
- /api/proto to store protobuf definitions HOT 1
- what is Hacker license? HOT 1
- Regarding the description of the deprecated tool golint HOT 3
- Better to use the Go team's examples of project layout HOT 1
- Official layout documentation HOT 3
- Should auxiliary code generators be in `cmd/` or in `tools/`? HOT 1
- what's the meaning of these three question after chinese translations ?
- "Discussions" tab HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from project-layout.