Comments (7)
What does go list
print when you run it in your project?
from heroku-buildpack-go.
It shows there are no .go files in the directory, which is true.
I have the entire workspace in the repo. My opinion is that external dependencies should be part of the repo and I would therefore like to structure it this way. I suspect that this may not be the way that the buildpack is designed to work?
What is your opinion on this?
from heroku-buildpack-go.
Much has been written on this topic in the context of Go. You can search the golang-nuts mailing list, or search Google to find blog articles about it.
My recommendation is to use a standard Go workspace, as described on https://golang.org/doc/code.html#Workspaces. Note the location of the .git
directories in the example. It is generally a mistake to have a src
directory that you create by hand in a Go project's repo.
Then, to make sure all your dependencies are contained within the repo, use a vendoring tool such as godep.
from heroku-buildpack-go.
Thank you for the answer!
I can definitely understand why many people really like the idea of using godeps, but I can not agree that it is generally a mistake to have a src directory in a Go repo. I don't agree with the idea of having all dependencies outside the repo is a good one. Github is a stable service today and for many years to come, but what if it some users with important repos will cancel their accounts in a couple of years? Or if Github itself not survive for another 10 years? That would break dependencies for a lot of projects. That's why I prefer to keep all dependencies inside the repo.
Would you be open to support my use case too, or are you determined to stay with godeps only? And by the way, thank you for the good work you already put into this project.
from heroku-buildpack-go.
I can not agree that it is generally a mistake to have a src directory in a Go repo.
That's just how the go tool was designed. I still suggest following the official instructions and example published by the Go team.
Github is a stable service today and for many years to come, but what if it some users with important repos will cancel their accounts in a couple of years? Or if Github itself not survive for another 10 years? That would break dependencies for a lot of projects. That's why I prefer to keep all dependencies inside the repo.
That's why people use tools such as godep. See also https://www.youtube.com/watch?v=myCHCXFFTPY for more on why it is a good idea to include your dependencies' source code in your repo (so called "vendoring").
Would you be open to support my use case too, or are you determined to stay with godeps only?
You absolutely don't have to use godep with this buildpack. I'm just suggesting that if you care about reproducibility, then you should really consider vendoring your dependencies. See https://camlistore.org/code for an example of a project that does vendoring without godep.
from heroku-buildpack-go.
Okay. So now I get it. I did never understand that godep actually solves my problem of not having external dependencies. I'm fairly new to Go and it really takes some time grasp the concept of Go workspaces (and godep). This is what I have been looking for and I haven't been able to find it, despite googling.
Thank you for taking your time to teach me. Excellent video.
from heroku-buildpack-go.
You're welcome! Sorry it was so difficult to find the information you were looking for. I hope the rest of your experience with this buildpack is more pleasant! :)
from heroku-buildpack-go.
Related Issues (20)
- Custom build tags HOT 1
- Builds failing on Go 1.16rc1 HOT 3
- Error decompressing go1.15.8.linux-amd64.tar.gz HOT 2
- Push rejected, failed to compile Go app. HOT 10
- Failed to compile Go app without vendor on Go 1.16 HOT 4
- Way to set GO111MODULE for 1.16?
- Custom Vendoring doesnt work!
- go: command not found HOT 4
- go_pre_compile does not work HOT 2
- Error decompressing go1.16.10.linux-amd64.tar.gz HOT 2
- Mulitple instances of app running HOT 2
- Requested file unknown to the buildpack HOT 5
- Add Go 1.18.6 and 1.19.1
- go cmd unavailable for go-pre-compile or go-post-compile HOT 1
- Add Go 1.20
- build fails on specific packages - go1.20
- Go 1.21.1 is released!
- Go 1.22 was released on 07.02.2024
- Feature Request: Optionally print `go env`
- Feature Request: Output any env vars that are picked up
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 heroku-buildpack-go.