diff --git a/go/store/constants/version.go b/go/store/constants/version.go index c951d2e061..b66e689b4b 100644 --- a/go/store/constants/version.go +++ b/go/store/constants/version.go @@ -5,10 +5,22 @@ // Package constants collects common constants used in Noms, such as the Noms data format version. package constants +import "os" + +func init() { + nbfVerStr := os.Getenv("DOLT_DEFAULT_BIN_FORMAT") + if nbfVerStr != "" { + FormatDefaultString = nbfVerStr + } +} + const NomsVersion = "7.18" var NomsGitSHA = "" +// See //go/store/types/format.go for corresponding formats. + const Format718String = "7.18" const FormatLD1String = "__LD_1__" -const FormatDefaultString = "7.18" + +var FormatDefaultString = Format718String diff --git a/go/store/types/format.go b/go/store/types/format.go index 8a96413af2..458c9e164f 100644 --- a/go/store/types/format.go +++ b/go/store/types/format.go @@ -1,8 +1,18 @@ package types -import "errors" -import "os" -import "github.com/liquidata-inc/ld/dolt/go/store/constants" +import ( + "errors" + + "github.com/liquidata-inc/ld/dolt/go/store/constants" +) + +func init() { + nbf, err := GetFormatForVersionString(constants.FormatDefaultString) + if err != nil { + panic("unrecognized value for DOLT_DEFAULT_BIN_FORMAT " + constants.FormatDefaultString) + } + Format_Default = nbf +} type NomsBinFormat struct { tag *formatTag @@ -41,15 +51,3 @@ func (nbf *NomsBinFormat) VersionString() string { panic("unrecognized NomsBinFormat tag value") } } - -func init() { - nbfVerStr := os.Getenv("DOLT_DEFAULT_BIN_FORMAT") - if nbfVerStr == "" { - nbfVerStr = constants.FormatDefaultString - } - nbf, err := GetFormatForVersionString(nbfVerStr) - if err != nil { - panic("unrecognized value for DOLT_DEFAULT_BIN_FORMAT " + nbfVerStr) - } - Format_Default = nbf -}