(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func 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. |
| 31 | func TestGoVersion(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…