(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestGoMod(t *testing.T) { |
| 14 | goMod, err := os.ReadFile("go.mod") |
| 15 | if err != nil { |
| 16 | t.Fatal(err) |
| 17 | } |
| 18 | f, err := modfile.Parse("go.mod", goMod, nil) |
| 19 | if err != nil { |
| 20 | t.Fatal(err) |
| 21 | } |
| 22 | if len(f.Replace) > 0 { |
| 23 | t.Errorf("go.mod has %d replace directives; expect zero in this repo", len(f.Replace)) |
| 24 | } |
| 25 | } |