(rootDir string)
| 32 | } |
| 33 | |
| 34 | func readGoModGoVersion(rootDir string) (*semver.Version, error) { |
| 35 | goModFile := "go.mod" |
| 36 | path := filepath.Join(rootDir, goModFile) |
| 37 | data, err := os.ReadFile(path) |
| 38 | if err != nil { |
| 39 | return nil, err |
| 40 | } |
| 41 | mod, err := modfile.Parse(goModFile, data, nil) |
| 42 | if err != nil { |
| 43 | return nil, err |
| 44 | } |
| 45 | |
| 46 | if mod.Go == nil { |
| 47 | return nil, fmt.Errorf("no go statement found in %s", path) |
| 48 | } |
| 49 | ver, err := semver.ParseTolerant(mod.Go.Version) |
| 50 | if err != nil { |
| 51 | return nil, err |
| 52 | } |
| 53 | return &ver, nil |
| 54 | } |
| 55 | |
| 56 | func rootCmdRun(cmd *cobra.Command, args []string) { |
| 57 | rootDir := goPath() + "/src/github.com/cilium/cilium" |
no test coverage detected
searching dependent graphs…