golang

package
v0.0.0-...-e6c773e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ModFilename = "go.mod"

Variables

This section is empty.

Functions

func SetGoVersionInGoMod

func SetGoVersionInGoMod()

SetGoVersionInGoMod updates the go directive in the go.mod file unless some exceptions are met.

If the major and minor version match the new version and the current patch version is 0, updating is skipped. This is requriered as some Kubernetes libraries mandate this through the peer dependency chain and tools like govulncheck and controller-gen refuse to work with this mismatch and mandate to run go mod tidy.

Types

type ScanResult

type ScanResult struct {
	ModulePath           string           // from "module" directive in go.mod, e.g. "github.com/foo/bar"
	GoVersion            string           // from "go" directive in go.mod, e.g. "1.22.0"
	GoVersionMajorMinor  string           // GoVersion but the patch version is stripped
	GoDirectDependencies []module.Version // from "require" directive(s) in go.mod without the "// indirect" comment
	HasBinInfo           bool             // whether we can produce linker instructions for "github.com/sapcc/go-api-declarations/bininfo"
	UseGinkgo            bool             // whether to use ginkgo test runner instead of go test
	UsesPostgres         bool             // whether postgres is used
	KubernetesController bool             // whether the repository contains a Kubernetes controller
	KubernetesVersion    string           // version of kubernetes to use, derived from k8s.io/api
}

ScanResult contains data obtained through a scan of the configuration files in the repository. At the moment, only `go.mod` is scanned.

TODO: make ScanResult generic and move Golang specific fields into sub-struct and add Rust next to it

func Scan

func Scan() ScanResult

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL