MCPcopy
hub / github.com/tailscale/tailscale / TestDockerfileVersion

Function TestDockerfileVersion

version_test.go:17–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15)
16
17func TestDockerfileVersion(t *testing.T) {
18 goVersion := mustGetGoModVersion(t, false)
19
20 dockerFile, err := os.ReadFile("Dockerfile")
21 if err != nil {
22 t.Fatal(err)
23 }
24 wantSub := fmt.Sprintf("FROM golang:%s-alpine AS build-env", goVersion)
25 if !strings.Contains(string(dockerFile), wantSub) {
26 t.Errorf("didn't find %q in Dockerfile", wantSub)
27 }
28}
29
30// TestGoVersion tests that the Go version specified in go.mod matches ./tool/go version.
31func TestGoVersion(t *testing.T) {

Callers

nothing calls this directly

Calls 5

mustGetGoModVersionFunction · 0.85
ReadFileMethod · 0.65
FatalMethod · 0.65
ErrorfMethod · 0.65
ContainsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…