tailscale / tailscale

The easiest, most secure way to use WireGuard and 2FA.
https://tailscale.com
BSD 3-Clause "New" or "Revised" License
19.25k stars 1.51k forks source link

`go install` from instructions in README fails #13153

Open samuelallan72 opened 2 months ago

samuelallan72 commented 2 months ago

What is the issue?

Following the instructions in the readme to install tailscale fails, both with the listed version of go (1.22) and latest go (1.23).

$ go version
go version go1.23.0 linux/amd64
$ go install tailscale.com/cmd/tailscale{,d}
go: 'go install' requires a version when current directory is not in a module
        Try 'go install tailscale.com/cmd/tailscale@latest tailscale.com/cmd/tailscaled@latest' to install the latest version

...

$ go version
go version go1.22.5 linux/amd64
$ go install tailscale.com/cmd/tailscale{,d}
go: 'go install' requires a version when current directory is not in a module
        Try 'go install tailscale.com/cmd/tailscale@latest tailscale.com/cmd/tailscaled@latest' to install the latest version

GOPATH is set to an existing writable directory.

Steps to reproduce

Install go @ 1.22 or 1.23. Then run the command from the readme in bash: go install tailscale.com/cmd/tailscale{,d}

Are there any recent changes that introduced the issue?

No response

OS

Linux

OS version

Ubuntu 24.04

Tailscale version

latest

Other software

No response

Bug report

No response

bradfitz commented 2 months ago

We don't support GOPATH mode. Run those go install commands from the git checkout directory, at or under the tailscale.com go.mod file directory.

bradfitz commented 2 months ago

You can use go install tailscale.com/cmd/tailscale{,d}@latest outside of a module, where latest can be either latest or a branch name (like main) or a specific git tag.

samuelallan72 commented 2 months ago

Ah I see, rereading the readme this is under the "building" section, so I guess it's assumed that you're running it from within the git repository? Could this be clarified in the readme? As a new user, wanting to install from source rather than adding the ppa, I was trying to follow the instructions there. :)