version

package
v1.0.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package version exposes the current Dagger build's version, commit, and dirty state.

The semantic version is the contents of the VERSION file at the package root, embedded at compile time via //go:embed.

Commit and dirty state come from runtime/debug build info, wrapped by github.com/dagger/go/buildinfo. Native `go build` outside the Dagger sandbox gets these for free from the toolchain's VCS detection. Sandboxed Dagger builds inject them via -ldflags into buildinfo's Injected* vars.

Index

Constants

This section is empty.

Variables

View Source
var Commit string

Commit is the VCS commit hash this binary was built from, or "" if unknown.

View Source
var CommitTime string

CommitTime is the commit time as RFC3339, or "" if unknown.

View Source
var Dirty bool

Dirty reports whether the source tree was modified at build time.

View Source
var Version string

Version is the semantic version of this Dagger build (e.g. "0.21.3"), read from the embedded VERSION file.

Functions

func Canonical

func Canonical() string

Canonical returns the canonical build identifier:

"0.21.3+42424242"        clean build
"0.21.3+42424242.dirty"  dirty build
"0.21.3"                 commit unknown

The commit is truncated to 8 characters for readability; use Commit directly for the full hash.

func CommitState

func CommitState() string

CommitState returns the short VCS revision, with "+dirty" appended when the source tree had modifications at build time.

func ShortCommit

func ShortCommit() string

ShortCommit returns the short VCS revision used in human-readable version output, or "" if the build's revision is unknown.

Types

This section is empty.

Jump to

Keyboard shortcuts

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