Skip to content

Commit

Permalink
Remove semver check in version
Browse files Browse the repository at this point in the history
  • Loading branch information
aswinkarthik committed Feb 28, 2019
1 parent 977b021 commit bb8d833
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 27 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func init() {
rootCmd.Flags().IntSliceVarP(&config.PrimaryKeyPositions, "primary-key", "p", []int{0}, "Primary key positions of the Input CSV as comma separated values Eg: 1,2")
rootCmd.Flags().IntSliceVarP(&config.ValueColumnPositions, "columns", "", []int{}, "Selectively compare positions in CSV Eg: 1,2. Default is entire row")
rootCmd.Flags().IntSliceVarP(&config.IncludeColumnPositions, "include", "", []int{}, "Include positions in CSV to display Eg: 1,2. Default is entire row")
rootCmd.Flags().StringVarP(&config.Format, "format", "o", "rowmark", fmt.Sprintf("Available (%s)", strings.Join(allFormats, "|")))
rootCmd.Flags().StringVarP(&config.Format, "format", "o", "diff", fmt.Sprintf("Available (%s)", strings.Join(allFormats, "|")))

rootCmd.Flags().BoolVarP(&timed, "time", "", false, "Measure time")
}
Expand Down
23 changes: 0 additions & 23 deletions cmd/version.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
package cmd

import (
"fmt"
"os"

"github.com/blang/semver"
)

// VersionString to display on --version call
const VersionString = "csvdiff v1.0.0"

const defaultVersion = "1.0-dev"

var version = defaultVersion
Expand All @@ -21,19 +11,6 @@ func SetVersion(_version string) {
return
}

v, err := semver.Make(_version)
if err != nil {
fmt.Fprintf(os.Stderr, "built with wrong version tag\n")
version = defaultVersion
return
}

if err = v.Validate(); err != nil {
fmt.Fprintf(os.Stderr, "built with wrong version tag\n")
version = defaultVersion
return
}

version = _version
}

Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module github.com/aswinkarthik/csvdiff

require (
github.com/OneOfOne/xxhash v1.2.2 // indirect
github.com/blang/semver v3.5.1+incompatible
github.com/cespare/xxhash v1.0.0
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/fatih/color v1.7.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/cespare/xxhash v1.0.0 h1:naDmySfoNg0nKS62/ujM6e71ZgM2AoVdaqGwMG0w18A=
github.com/cespare/xxhash v1.0.0/go.mod h1:fX/lfQBkSCDXZSUgv6jVIu/EVA3/JNseAX5asI4c4T4=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
Expand Down

0 comments on commit bb8d833

Please sign in to comment.