ensure

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequiredVersion

func RequiredVersion(ctx context.Context) error

RequiredVersion makes sure the version of the tool currently running is the same as the one required in the current working directory's "go.mod" file.

If this returns `nil`, the current process is running the correct version of the tool and can proceed with it's intended purpose. If it returns an IncorrectVersionError, the caller should determine whether to print a warning or exit in error, presenting the returned error to the user.

Types

type IncorrectVersionError added in v1.1.0

type IncorrectVersionError struct {
	// RequiredVersion is the version declared in `go.mod`, or a blank string if a `replace` directive
	// for "github.com/DataDog/orchestrion" is present in `go.mod`.
	RequiredVersion string
}

IncorrectVersionError is returned by RequiredVersion when the version of orchestrion running does not match the one required by `go.mod`.

func (IncorrectVersionError) Error added in v1.1.0

func (e IncorrectVersionError) Error() string

Jump to

Keyboard shortcuts

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