From 7d1319f8ac864d5f9b428521264fd0e2e0d8801a Mon Sep 17 00:00:00 2001 From: Max Resnick Date: Tue, 2 Jan 2024 22:18:46 -0800 Subject: chore: fix linting/vet issues --- main.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index efbc4f1..38f131e 100644 --- a/main.go +++ b/main.go @@ -1,3 +1,4 @@ +// go bump ver tool package main import ( @@ -18,11 +19,14 @@ import ( "github.com/Masterminds/semver/v3" ) +// FmtPart format keywords type FmtPart string var ( + // BumpInt an int to be bumped BumpInt FmtPart = "$BumpInt" - KeyArg FmtPart = "$KeyArg" + // KeyArg an keyword argument to the format + KeyArg FmtPart = "$KeyArg" ) type preReleaseVersion struct { @@ -99,10 +103,8 @@ func (prf *preReleaseVersion) incPreRelease() (semver.Version, error) { } var ( - errNoRemoteFound = errors.New("No remotes found") validArgs = []string{"major", "minor", "patch"} - remoteName string - preReleaseFmtArgs map[string]string = make(map[string]string) + preReleaseFmtArgs = make(map[string]string) preRelease bool rootCmd = &cobra.Command{ Use: "semverbump part [major|minor|patch] file [-|file]", @@ -227,6 +229,7 @@ func init() { rootCmd.PersistentFlags().String("prerelease-fmt", "PR.$KeyArg PR_NUM.$BumpInt", "The format string for prerelease versions") rootCmd.PersistentFlags().StringToStringVarP(&preReleaseFmtArgs, "key-args", "k", nil, "key=arg for the fmt string") rootCmd.PersistentFlags().String("repo-dir", cwd, "repo to examine") - remoteName = *rootCmd.PersistentFlags().String("remote-name", "origin", "remote to search and push to") - viper.BindPFlags(rootCmd.PersistentFlags()) + if err := viper.BindPFlags(rootCmd.PersistentFlags()); err != nil { + log.Fatal(err) + } } -- cgit v1.2.3