()
| 25 | ) |
| 26 | |
| 27 | func K8sIOClientGoModVersion() (string, error) { |
| 28 | info, ok := debug.ReadBuildInfo() |
| 29 | if !ok { |
| 30 | return "", errors.New("failed to read build info") |
| 31 | } |
| 32 | |
| 33 | idx := slices.IndexFunc(info.Deps, func(m *debug.Module) bool { |
| 34 | return m.Path == "k8s.io/client-go" |
| 35 | }) |
| 36 | |
| 37 | if idx == -1 { |
| 38 | return "", errors.New("k8s.io/client-go not found in build info") |
| 39 | } |
| 40 | |
| 41 | m := info.Deps[idx] |
| 42 | |
| 43 | return m.Version, nil |
| 44 | } |
no outgoing calls
searching dependent graphs…