Skip to content

Commit

Permalink
version code moved to difference files
Browse files Browse the repository at this point in the history
  • Loading branch information
GDW1 committed Jul 15, 2023
1 parent 126b780 commit 29c082f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func preExecHook(cmd *cobra.Command, args []string) {
_ = os.Remove(os.TempDir() + timestampFileName)
_, err = os.Create(os.TempDir() + timestampFileName)
if err != nil {
log.Errorf("failed to create version check timestamp file: %w", err.Error())
log.Errorf("failed to create version check timestamp file: %v", err.Error())
}
}

Expand Down
1 change: 1 addition & 0 deletions cmd/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package version

import (
"fmt"

"github.com/spf13/cobra"

"github.com/cisco-open/fsoc/cmd/config"
Expand Down
7 changes: 4 additions & 3 deletions cmd/version/version_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package version

import (
"fmt"
"github.com/Masterminds/semver/v3"
"github.com/apex/log"
"net/http"
"strings"

"github.com/Masterminds/semver/v3"
"github.com/apex/log"
)

const (
Expand Down Expand Up @@ -40,7 +41,7 @@ func CheckForUpdate(versionChannel chan *semver.Version) {
}
newestVersionSemVar, err := semver.NewVersion(newestVersion)
if err != nil {
log.WithField("unparseable version", newestVersion).Warnf("Could not parse version string: %w", err.Error())
log.WithField("unparseable version", newestVersion).Warnf("Could not parse version string: %v", err.Error())
}
versionChannel <- newestVersionSemVar
}
Expand Down

0 comments on commit 29c082f

Please sign in to comment.