mageutil

package
v1.235.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const RootModuleDecl = "module github.com/cloudposse/atmos"

RootModuleDecl is the expected first line of the root module's go.mod, used by RepoRoot to recognize the repository root.

Variables

View Source
var ErrRepoRootNotFound = errors.New("mage: could not locate repository root (go.mod for module github.com/cloudposse/atmos)")

Functions

func DirHasFileNewerThan

func DirHasFileNewerThan(dir string, cutoff time.Time, match func(name string) bool) (bool, error)

DirHasFileNewerThan reports whether dir contains a regular file, accepted by match, whose modification time is after cutoff. It is the cross-platform replacement for `find <dir> -type f ... -newer <ref> -print -quit`.

func GoVersion

func GoVersion() (string, error)

GoVersion returns `go env GOVERSION` verbatim (e.g. "go1.26.4").

func IsGoModuleFile

func IsGoModuleFile(name string) bool

IsGoModuleFile reports whether name is a Go source file or a module manifest (go.mod/go.sum).

func IsGoSourceFile

func IsGoSourceFile(name string) bool

IsGoSourceFile reports whether name is a Go source file.

func RepoRoot

func RepoRoot() (string, error)

RepoRoot walks up from the working directory looking for the go.mod that declares this module, so targets behave the same regardless of the directory they're invoked from.

func RunIn

func RunIn(dir string, extraEnv []string, name string, args ...string) error

RunIn runs name with args in dir, with extraEnv appended on top of the current process environment (so later duplicate keys win), streaming output directly to this process's stdout/stderr.

Types

This section is empty.

Jump to

Keyboard shortcuts

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