Answer the question
In order to leave comments, you need to log in
Why do projects call the subfolder Vendor if go build looks for pkg in src?
Hello.
let's say there is a project on golang
nginx-prometheus-exporter
external unique pkg is placed in the vendor subfolder
if you go to build a go project
let 's say
go build -i -o /tmp/___go_build_haproxy_exporter_go /home/drno/IdeaProjects/prometheus_node_exporter/exporter.go
GOPATH="/home/drno/IdeaProjects/nginx-prometheus-exporter"
$GOPATH/src
Answer the question
In order to leave comments, you need to log in
You do not have a correct understanding of the value of the vendor directory.
No need to redefine gopath, go looks for dependencies not only in gopath but also in the vendor directory at the root of the project. This is used to freeze current dependencies.
https://blog.gopheracademy.com/advent-2015/vendor-...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question