From 39a4baf2875903e0cd95bb979735d1803c23e8f0 Mon Sep 17 00:00:00 2001 From: Marius Merschformann Date: Thu, 14 Mar 2024 18:08:25 +0100 Subject: [PATCH] Removing version --- VERSION | 1 - run/flagparser.go | 6 ++---- version.go | 41 ----------------------------------------- 3 files changed, 2 insertions(+), 46 deletions(-) delete mode 100644 VERSION delete mode 100644 version.go diff --git a/VERSION b/VERSION deleted file mode 100644 index fd5a288b..00000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -v2.0.0-dev.0 diff --git a/run/flagparser.go b/run/flagparser.go index bec198ae..473ee17d 100644 --- a/run/flagparser.go +++ b/run/flagparser.go @@ -7,7 +7,6 @@ import ( "strings" "github.com/itzg/go-flagsfiller" - "github.com/nextmv-io/sdk" ) // FlagParser parses flags and env vars and returns a runner config and options. @@ -43,10 +42,9 @@ func usage() { fs := flag.NewFlagSet(os.Args[0], flag.ExitOnError) out := fs.Output() - fmt.Fprintf( + fmt.Fprint( out, - "Nextmv Hybrid Optimization Platform %s\n", - sdk.VERSION, + "Nextmv Hybrid Optimization Platform\n", ) fmt.Fprint(out, "Usage:\n") flag.PrintDefaults() diff --git a/version.go b/version.go deleted file mode 100644 index 16789666..00000000 --- a/version.go +++ /dev/null @@ -1,41 +0,0 @@ -// Package sdk provides API declarations of the Nextmv software development -// kit. Please visit the associated packages (directories) for complete -// documentation. -package sdk - -import ( - _ "embed" - "runtime/debug" - "strings" -) - -// VERSION of Nextmv SDK. -// -//go:embed VERSION -var versionFallback string - -// VERSION of Nextmv SDK. -var VERSION = getVersion() - -func getVersion() string { - // Get version from module dependency. - bi, ok := debug.ReadBuildInfo() - if !ok { - // If this happens, we're not running in a module context. We default to - // returning the fallback version. - return versionFallback - } - - for _, dep := range bi.Deps { - // We only care about this repo being used as a dependency. - if !strings.HasPrefix(dep.Path, "github.com/nextmv-io/sdk") { - continue - } - - return dep.Version - } - - // If this happens, we're running in a module in which sdk is not a - // dependency. - return versionFallback -}