From 0fe79c4b989418dd1056ca07f3c5f2e1e1247adb Mon Sep 17 00:00:00 2001 From: tamal Date: Mon, 3 Jul 2017 12:54:26 -0700 Subject: [PATCH] Print commit timestamp with version command --- glide.lock | 10 +++++----- vendor/github.com/appscode/go/version/version.go | 4 +--- vendor/github.com/onsi/gomega/format/format.go | 15 +++++---------- vendor/github.com/onsi/gomega/matchers/and.go | 5 ++--- .../onsi/gomega/matchers/receive_matcher.go | 12 ++++-------- .../bipartitegraph/bipartitegraphmatching.go | 6 ++---- .../onsi/gomega/matchers/type_support.go | 9 +++------ vendor/github.com/prometheus/common/model/time.go | 14 +------------- 8 files changed, 23 insertions(+), 52 deletions(-) diff --git a/glide.lock b/glide.lock index b0ee945dd..d4730b403 100644 --- a/glide.lock +++ b/glide.lock @@ -1,8 +1,8 @@ hash: f6401bf7ae726163fca774326545e264d044ea66520622e4c21fc78f14bb546f -updated: 2017-06-29T06:58:03.997800894-07:00 +updated: 2017-07-03T12:52:12.057609421-07:00 imports: - name: github.com/appscode/go - version: ecda61fa4e8943020e9948723e49c4ae544f7a3a + version: 9fde097ebcef0add8325c8fbee63ae01e7da530e subpackages: - crypto/rand - runtime @@ -106,7 +106,7 @@ imports: subpackages: - pbutil - name: github.com/onsi/gomega - version: f9b2e15b86f3d6dd556700ffbaa4feee86745028 + version: c990b8b3a34c8814a6657daebe8e19ff4d9647a1 subpackages: - format - internal/assertion @@ -130,7 +130,7 @@ imports: subpackages: - go - name: github.com/prometheus/common - version: 0866df4b85a18d652b6965be022d007cdf076822 + version: 13ba4ddd0caa9c28ca7b7bffe1dfa9ed8d5ef207 subpackages: - expfmt - internal/bitbucket.org/ww/goautoneg @@ -364,7 +364,7 @@ testImports: - name: github.com/mitchellh/go-homedir version: d682a8f0cf139663a984ff12528da460ca963de9 - name: github.com/onsi/ginkgo - version: 6665a7cf0a58963034f099ffcd3bc4e4a11c300c + version: 1e72798a2620664d2ab32ffd4473c102fcd4894d subpackages: - config - internal/codelocation diff --git a/vendor/github.com/appscode/go/version/version.go b/vendor/github.com/appscode/go/version/version.go index 04e501e20..23114f4e2 100644 --- a/vendor/github.com/appscode/go/version/version.go +++ b/vendor/github.com/appscode/go/version/version.go @@ -30,9 +30,7 @@ func (v *version) Print() { fmt.Printf("CommitHash = %v\n", v.CommitHash) fmt.Printf("GitBranch = %v\n", v.GitBranch) fmt.Printf("GitTag = %v\n", v.GitTag) - if v.CommitTimestamp != "" { - fmt.Printf("CommitTimestamp = %v\n", v.CommitTimestamp) - } + fmt.Printf("CommitTimestamp = %v\n", v.CommitTimestamp) if v.BuildTimestamp != "" { fmt.Printf("BuildTimestamp = %v\n", v.BuildTimestamp) diff --git a/vendor/github.com/onsi/gomega/format/format.go b/vendor/github.com/onsi/gomega/format/format.go index a9d265136..e206ee59a 100644 --- a/vendor/github.com/onsi/gomega/format/format.go +++ b/vendor/github.com/onsi/gomega/format/format.go @@ -64,9 +64,8 @@ If expected is omited, then the message looks like: func Message(actual interface{}, message string, expected ...interface{}) string { if len(expected) == 0 { return fmt.Sprintf("Expected\n%s\n%s", Object(actual, 1), message) - } else { - return fmt.Sprintf("Expected\n%s\n%s\n%s", Object(actual, 1), message, Object(expected[0], 1)) } + return fmt.Sprintf("Expected\n%s\n%s\n%s", Object(actual, 1), message, Object(expected[0], 1)) } /* @@ -265,9 +264,8 @@ func formatValue(value reflect.Value, indentation uint) string { default: if value.CanInterface() { return fmt.Sprintf("%#v", value.Interface()) - } else { - return fmt.Sprintf("%#v", value) } + return fmt.Sprintf("%#v", value) } } @@ -311,9 +309,8 @@ func formatSlice(v reflect.Value, indentation uint) string { if longest > longFormThreshold { indenter := strings.Repeat(Indent, int(indentation)) return fmt.Sprintf("[\n%s%s,\n%s]", indenter+Indent, strings.Join(result, ",\n"+indenter+Indent), indenter) - } else { - return fmt.Sprintf("[%s]", strings.Join(result, ", ")) } + return fmt.Sprintf("[%s]", strings.Join(result, ", ")) } func formatMap(v reflect.Value, indentation uint) string { @@ -332,9 +329,8 @@ func formatMap(v reflect.Value, indentation uint) string { if longest > longFormThreshold { indenter := strings.Repeat(Indent, int(indentation)) return fmt.Sprintf("{\n%s%s,\n%s}", indenter+Indent, strings.Join(result, ",\n"+indenter+Indent), indenter) - } else { - return fmt.Sprintf("{%s}", strings.Join(result, ", ")) } + return fmt.Sprintf("{%s}", strings.Join(result, ", ")) } func formatStruct(v reflect.Value, indentation uint) string { @@ -355,9 +351,8 @@ func formatStruct(v reflect.Value, indentation uint) string { if longest > longFormThreshold { indenter := strings.Repeat(Indent, int(indentation)) return fmt.Sprintf("{\n%s%s,\n%s}", indenter+Indent, strings.Join(result, ",\n"+indenter+Indent), indenter) - } else { - return fmt.Sprintf("{%s}", strings.Join(result, ", ")) } + return fmt.Sprintf("{%s}", strings.Join(result, ", ")) } func isNilValue(a reflect.Value) bool { diff --git a/vendor/github.com/onsi/gomega/matchers/and.go b/vendor/github.com/onsi/gomega/matchers/and.go index 94c42a7db..d83a29164 100644 --- a/vendor/github.com/onsi/gomega/matchers/and.go +++ b/vendor/github.com/onsi/gomega/matchers/and.go @@ -57,8 +57,7 @@ func (m *AndMatcher) MatchMayChangeInTheFuture(actual interface{}) bool { } } return false // none of were going to change - } else { - // one of the matchers failed.. it must be able to change in order to affect the result - return oraclematcher.MatchMayChangeInTheFuture(m.firstFailedMatcher, actual) } + // one of the matchers failed.. it must be able to change in order to affect the result + return oraclematcher.MatchMayChangeInTheFuture(m.firstFailedMatcher, actual) } diff --git a/vendor/github.com/onsi/gomega/matchers/receive_matcher.go b/vendor/github.com/onsi/gomega/matchers/receive_matcher.go index 7a8c2cda5..74e9e7ebe 100644 --- a/vendor/github.com/onsi/gomega/matchers/receive_matcher.go +++ b/vendor/github.com/onsi/gomega/matchers/receive_matcher.go @@ -64,9 +64,8 @@ func (matcher *ReceiveMatcher) Match(actual interface{}) (success bool, err erro if didReceive { matcher.receivedValue = value return subMatcher.Match(matcher.receivedValue.Interface()) - } else { - return false, nil } + return false, nil } if didReceive { @@ -76,9 +75,8 @@ func (matcher *ReceiveMatcher) Match(actual interface{}) (success bool, err erro } return true, nil - } else { - return false, nil } + return false, nil } func (matcher *ReceiveMatcher) FailureMessage(actual interface{}) (message string) { @@ -94,9 +92,8 @@ func (matcher *ReceiveMatcher) FailureMessage(actual interface{}) (message strin return subMatcher.FailureMessage(matcher.receivedValue.Interface()) } return "When passed a matcher, ReceiveMatcher's channel *must* receive something." - } else { - return format.Message(actual, "to receive something."+closedAddendum) } + return format.Message(actual, "to receive something."+closedAddendum) } func (matcher *ReceiveMatcher) NegatedFailureMessage(actual interface{}) (message string) { @@ -112,9 +109,8 @@ func (matcher *ReceiveMatcher) NegatedFailureMessage(actual interface{}) (messag return subMatcher.NegatedFailureMessage(matcher.receivedValue.Interface()) } return "When passed a matcher, ReceiveMatcher's channel *must* receive something." - } else { - return format.Message(actual, "not to receive anything."+closedAddendum) } + return format.Message(actual, "not to receive anything."+closedAddendum) } func (matcher *ReceiveMatcher) MatchMayChangeInTheFuture(actual interface{}) bool { diff --git a/vendor/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph/bipartitegraphmatching.go b/vendor/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph/bipartitegraphmatching.go index 32529c511..8181f43a4 100644 --- a/vendor/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph/bipartitegraphmatching.go +++ b/vendor/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph/bipartitegraphmatching.go @@ -101,9 +101,8 @@ func (bg *BipartiteGraph) createSLAPGuideLayers(matching EdgeSet) (guideLayers [ if len(currentLayer) == 0 { return []NodeOrderedSet{} - } else { - guideLayers = append(guideLayers, currentLayer) } + guideLayers = append(guideLayers, currentLayer) done := false @@ -152,9 +151,8 @@ func (bg *BipartiteGraph) createSLAPGuideLayers(matching EdgeSet) (guideLayers [ if len(currentLayer) == 0 { return []NodeOrderedSet{} - } else { - guideLayers = append(guideLayers, currentLayer) } + guideLayers = append(guideLayers, currentLayer) } return diff --git a/vendor/github.com/onsi/gomega/matchers/type_support.go b/vendor/github.com/onsi/gomega/matchers/type_support.go index 04020f004..b05a5e75d 100644 --- a/vendor/github.com/onsi/gomega/matchers/type_support.go +++ b/vendor/github.com/onsi/gomega/matchers/type_support.go @@ -53,9 +53,8 @@ func toInteger(a interface{}) int64 { return int64(reflect.ValueOf(a).Uint()) } else if isFloat(a) { return int64(reflect.ValueOf(a).Float()) - } else { - panic(fmt.Sprintf("Expected a number! Got <%T> %#v", a, a)) } + panic(fmt.Sprintf("Expected a number! Got <%T> %#v", a, a)) } func toUnsignedInteger(a interface{}) uint64 { @@ -65,9 +64,8 @@ func toUnsignedInteger(a interface{}) uint64 { return reflect.ValueOf(a).Uint() } else if isFloat(a) { return uint64(reflect.ValueOf(a).Float()) - } else { - panic(fmt.Sprintf("Expected a number! Got <%T> %#v", a, a)) } + panic(fmt.Sprintf("Expected a number! Got <%T> %#v", a, a)) } func toFloat(a interface{}) float64 { @@ -77,9 +75,8 @@ func toFloat(a interface{}) float64 { return float64(reflect.ValueOf(a).Uint()) } else if isFloat(a) { return reflect.ValueOf(a).Float() - } else { - panic(fmt.Sprintf("Expected a number! Got <%T> %#v", a, a)) } + panic(fmt.Sprintf("Expected a number! Got <%T> %#v", a, a)) } func isError(a interface{}) bool { diff --git a/vendor/github.com/prometheus/common/model/time.go b/vendor/github.com/prometheus/common/model/time.go index 7e87f1ac6..548968aeb 100644 --- a/vendor/github.com/prometheus/common/model/time.go +++ b/vendor/github.com/prometheus/common/model/time.go @@ -163,21 +163,9 @@ func (t *Time) UnmarshalJSON(b []byte) error { // This type should not propagate beyond the scope of input/output processing. type Duration time.Duration -// Set implements pflag/flag.Value -func (d *Duration) Set(s string) error { - var err error - *d, err = ParseDuration(s) - return err -} - -// Type implements pflag.Value -func (d *Duration) Type() string { - return "duration" -} - var durationRE = regexp.MustCompile("^([0-9]+)(y|w|d|h|m|s|ms)$") -// ParseDuration parses a string into a time.Duration, assuming that a year +// StringToDuration parses a string into a time.Duration, assuming that a year // always has 365d, a week always has 7d, and a day always has 24h. func ParseDuration(durationStr string) (Duration, error) { matches := durationRE.FindStringSubmatch(durationStr)