MCPcopy Index your code
hub / github.com/dagger/dagger / NormalizeVersion

Function NormalizeVersion

engine/version.go:120–136  ·  view source on GitHub ↗
(version string)

Source from the content-addressed store, hash-verified

118}
119
120func NormalizeVersion(version string) string {
121 version = cleanVersion(version)
122 switch {
123 case version == "":
124 // if the target version is empty, this is weird, but probably because
125 // someone did a manual build - so just assume they know what they're
126 // doing, and set it to be the latest we know about
127 return Version
128 case !semver.IsValid(version):
129 // older versions of dagger don't all use semver, so if it's a
130 // non-semver version, assume it's v0.11.9 (not perfect, but it's a
131 // pretty good guess)
132 return presemverModuleVersion
133 default:
134 return version
135 }
136}
137
138func BaseVersion(version string) string {
139 version = strings.TrimSuffix(version, semver.Build(version))

Callers 10

ParseModuleConfigFunction · 0.92
dangImplForFunction · 0.92
initFromModConfigMethod · 0.92
loadDependencyModulesMethod · 0.92
ConnectFunction · 0.92
ConnectEngineToEngineFunction · 0.92
ServeHTTPMethod · 0.92
TestNormalizeVersionFunction · 0.85

Calls 1

cleanVersionFunction · 0.85

Tested by 1

TestNormalizeVersionFunction · 0.68