MCPcopy Index your code
hub / github.com/commitdev/zero / ValidateZeroVersion

Function ValidateZeroVersion

internal/config/moduleconfig/module_config.go:51–65  ·  view source on GitHub ↗

ValidateZeroVersion receives a module config, and returns whether the running zero's binary is compatible with the module

(mc ModuleConfig)

Source from the content-addressed store, hash-verified

49// ValidateZeroVersion receives a module config, and returns whether the running zero's binary
50// is compatible with the module
51func ValidateZeroVersion(mc ModuleConfig) bool {
52 if mc.ZeroVersion.String() == "" {
53 return true
54 }
55
56 zeroVersion := version.AppVersion
57 flog.Debugf("Checking Zero version (%s) against %s", zeroVersion, mc.ZeroVersion)
58
59 // Unreleased versions or test runs, defaults to SNAPSHOT when not declared
60 if zeroVersion == "SNAPSHOT" {
61 return true
62 }
63
64 return checkVersionAgainstConstrains(mc.ZeroVersion, zeroVersion)
65}
66
67type Parameter struct {
68 Field string

Callers 3

TestParseModuleConfigFunction · 0.92
LoadModuleConfigFunction · 0.85

Calls 2

DebugfFunction · 0.92

Tested by 2

TestParseModuleConfigFunction · 0.74