mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2026-02-03 06:03:25 +00:00
Go get downloads bin #198
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @naguam on GitHub.
Hello,
I wanted to build your project to build an instance because of the "death" of the storj.io transfer.sh website.
I got curious about the go get behaviour with the modules, because before building, in the dependencies in the go directory where everything is downloaded with
go get -u -v ./..., i got a working transfer.sh binary in /home/myuser/go/bin.So for testing, I decided to not even clone the repository and just do
GO111MODULE=on go get -u github.com/dutchcoders/transfer.sh@masterAnd I also got the working binary.
It is a bit strange when wanting to build from source, we have the full working binary as dependency.
In this case, why building from source if building from source implies a binary ?
Maybe go get build the binary dependency (I'm not really convinced because the README.md says we have to build after the go get).
I don't really now how to formulate my question, but if someone can explain this to me, I'll appreciate 👍
Thank in advance.
@paolafrancesca commented on GitHub:
@naguam that's what
go getis supposed to do: https://golang.org/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_themthe binary is not a dependency, it is installed by
go get. if you don't want to build and install it you have to pass-dif you want to have the source code for modification/whatever you should not use
go getbut rather clone the repo with git: this way you have an isolated copy of the source code you can deviate from that won't affect the go envoriment (imagine you change the code from the go pkg folder and then another project uses tranfer.sh as dependency: this project will be affected too)README.md may be wrong, I will review it
@paolafrancesca commented on GitHub:
README.md has
go get -u -v ./..., from the cloned repo (even if not specified), to download the dependecies@naguam commented on GitHub:
I understand it is not for the README.md to explain go tools and this is not the problem.
However thank you for all theses explanations. I think I can close the issue.
@paolafrancesca commented on GitHub:
@naguam see updated README.md https://github.com/dutchcoders/transfer.sh/pull/328/files
with go modules
go buildwill fetch the depdencies for youto clarify: it doesn't download the binary, it builds and installs it in the GOPATH
the binary built with the last step (
go build -o transfersh main.go) is saved in the same folder of the checkout repo not in the GOPATHit is not the purpose of the README to explain the details of go tools, but in the new README.md I've reduced all the undeeded steps
@naguam commented on GitHub:
Thank you for the answer (the test when didn't cloned was to verify I could really have a working binary without the sources)
So with the sources: I tried
go get -u -v ./...as in the README.md and it downloads also the binary.Just doing go build without this first step don't download the binary and only the dependencies automatically for then build the binary but at the path I specified and it is not a downloaded bin.
I think it's strange that go get (as specified in the README.md) downloads also the binary even if it is not used as a dependency, go get here is used for the dependencies at the base for then just do go build.