summaryrefslogtreecommitdiffhomepage
path: root/version/cmdname.go
AgeCommit message (Collapse)AuthorFilesLines
2023-02-01all: update to Go 1.20, use strings.CutPrefix/Suffix instead of our forkBrad Fitzpatrick1-3/+1
Updates #7123 Updates #5309 Change-Id: I90bcd87a2fb85a91834a0dd4be6e03db08438672 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2023-01-27all: update copyright and license headersWill Norris1-3/+2
This updates all source files to use a new standard header for copyright and license declaration. Notably, copyright no longer includes a date, and we now use the standard SPDX-License-Identifier header. This commit was done almost entirely mechanically with perl, and then some minimal manual fixes. Updates #6865 Signed-off-by: Will Norris <will@tailscale.com>
2022-11-21all: use strs.CutPrefix and strs.CutSuffix moreMihai Parparita1-3/+4
Updates places where we use HasPrefix + TrimPrefix to use the combined function. Updates #5309 Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2022-11-04all: remove old +build tagsBrad Fitzpatrick1-1/+0
The //go:build syntax was introduced in Go 1.17: https://go.dev/doc/go1.17#build-lines gofmt has kept the +build and go:build lines in sync since then, but enough time has passed. Time to remove them. Done with: perl -i -npe 's,^// \+build.*\n,,' $(git grep -l -F '+build') Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-09-20version: fix CmdName on the tailscale-ipn.exe binaryBrad Fitzpatrick1-2/+11
Don't return "wg64", "wg32", etc. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-08-17all: simplify build tags involving iOSJosh Bleecher Snyder1-2/+2
Prior to Go 1.16, iOS used GOOS=darwin, so we had to distinguish macOS from iOS during GOARCH. We now require Go 1.16 in our go.mod, so we can simplify. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-08-09version: remove rsc.io/goversion dependencyJosh Bleecher Snyder1-4/+87
rsc.io/goversion is really expensive. Running version.ReadExe on tailscaled on darwin allocates 47k objects, almost 11mb. All we want is the module info. For that, all we need to do is scan through the binary looking for the magic start/end strings and then grab the bytes in between them. We can do that easily and quickly with nothing but a 64k buffer. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-08-05all: gofmt with Go 1.17Josh Bleecher Snyder1-0/+1
This adds "//go:build" lines and tidies up existing "// +build" lines. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-02-09portlist, version: update build tags for Go 1.16, Apple M1moncho1-1/+1
Build tags have been updated to build native Apple M1 binaries, existing build tags for ios have been changed from darwin,arm64 to ios,arm64. With this change, running go build cmd/tailscale{,d}/tailscale{,d}.go on an Apple machine with the new processor works and resulting binaries show the expected architecture, e.g. tailscale: Mach-O 64-bit executable arm64. Tested using go version go1.16beta1 darwin/arm64. Updates #943 Signed-off-by: moncho <50428+moncho@users.noreply.github.com>
2020-07-30version: revert the filepath change from earlier commitBrad Fitzpatrick1-11/+16
f81233524fddeec450940af8dc1a0dd8841bf28c changed a use of package 'path' to 'filepath'. Restore it back to 'path', with a comment. Also, use the os.Executable-based fallback name in the case where the binary itself doesn't have Go module information. That was overlooked in the original code.
2020-07-30version/cmdname: s/path/filepath/ and fix version.ReadExe() fallback.v1.1.0Avery Pennarun1-2/+3
We were using the Go 'path' module, which apparently doesn't handle backslashes correctly. path/filepath does. However, the main bug turned out to be that we were not calling .Base() on the path if version.ReadExe() fails, which it seems to do at least on Windows 7. As a result, our logfile persistence was not working on Windows, and logids would be regenerated on every restart. Affects: #620 Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-06-08version: fix typo in commentBrad Fitzpatrick1-1/+1
2020-04-07version: don't depend on goversion on iosBrad Fitzpatrick1-0/+2
2020-02-19version: add CmdName func for future use by logpolicyBrad Fitzpatrick1-0/+41
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com> Change-Id: I02a7c907844f71242ef06ed097f2a92ece7ae091