mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-30 05:25:35 +00:00
26 lines
468 B
Go
26 lines
468 B
Go
|
// Copyright (c) Tailscale Inc & AUTHORS
|
||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||
|
|
||
|
package tailscaleroot
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"testing"
|
||
|
|
||
|
"golang.org/x/mod/modfile"
|
||
|
)
|
||
|
|
||
|
func TestGoMod(t *testing.T) {
|
||
|
goMod, err := os.ReadFile("go.mod")
|
||
|
if err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
f, err := modfile.Parse("go.mod", goMod, nil)
|
||
|
if err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
if len(f.Replace) > 0 {
|
||
|
t.Errorf("go.mod has %d replace directives; expect zero in this repo", len(f.Replace))
|
||
|
}
|
||
|
}
|