Documentation
¶
Overview ¶
Package version is weft's one version string: the framework module's release tag, stamped into Studio's api/meta, the devtools panel bundle, the otel resource, the runtime's registration and the binaries' version output. It imports nothing but the standard library, so any layer can carry it.
Index ¶
Examples ¶
Constants ¶
const Version = "v0.12.0"
Version is the framework module's release tag. The release process bumps it with the tag (and rebuilds studio/dist, whose panel bundle is stamped from this line by studio/web/vite.panel.config.ts); it moves for nothing else. studio's tests fail when studio.Version or the embedded panel disagree with it. The second place to bump is core/observe.go's own version literal (the weft.version every run stamps; core imports nothing of this module), which otel/hardening_test.go pins against this one.
Variables ¶
This section is empty.
Functions ¶
func Runtime ¶
func Runtime() string
Runtime reports the version of the framework module this binary was built from, read from debug.ReadBuildInfo: the main module's version when the binary is weft's own, else the version of the github.com/weftgo/weft dependency (its replacement's, when replaced by another version). Where the build info has no version — inside the workspace or a test, where it reads "(devel)", or a replacement by a local directory — it returns Version, the tag the source carries. So does a build stamped from version control rather than a tag (Go 1.24 and later): a pseudo-version (v0.9.1-0.20260101120000- abcdef123456) or a "+dirty" one names a commit, not a release.
Example ¶
Runtime is what a binary prints for its version: the tag a consumer built against, or the source's own tag inside the workspace.
package main
import (
"fmt"
"github.com/weftgo/weft/version"
)
func main() {
v := version.Runtime()
fmt.Println(v == version.Version) // in this repository's tests, build info reads "(devel)"
}
Output: true
Types ¶
This section is empty.