MCPcopy
hub / github.com/tailscale/tailscale / init

Function init

assert_ts_toolchain_match.go:14–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12)
13
14func init() {
15 tsRev, ok := tailscaleToolchainRev()
16 if !ok {
17 panic("binary built with tailscale_go build tag but failed to read build info or find tailscale.toolchain.rev in build info")
18 }
19 want := strings.TrimSpace(GoToolchainRev)
20 // Also permit the "next" toolchain rev, which is used in the main branch and will eventually become the new "current" rev.
21 // This allows building with TS_GO_NEXT=1 and then running the resulting binary without TS_GO_NEXT=1.
22 wantAlt := strings.TrimSpace(GoToolchainNextRev)
23 if tsRev != want && tsRev != wantAlt {
24 if os.Getenv("TS_PERMIT_TOOLCHAIN_MISMATCH") == "1" {
25 fmt.Fprintf(os.Stderr, "tailscale.toolchain.rev = %q, want %q; but ignoring due to TS_PERMIT_TOOLCHAIN_MISMATCH=1\n", tsRev, want)
26 return
27 }
28 panic(fmt.Sprintf("binary built with tailscale_go build tag but Go toolchain %q doesn't match github.com/tailscale/tailscale expected value %q; override this failure with TS_PERMIT_TOOLCHAIN_MISMATCH=1", tsRev, want))
29 }
30}

Callers

nothing calls this directly

Calls 1

tailscaleToolchainRevFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…