Sfoglia il codice sorgente

Merge pull request #18745 from runcom/pkg-version-String

pkg: version: add String method
Tibor Vass 9 anni fa
parent
commit
9681f0f0d4
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      pkg/version/version.go

+ 5 - 0
pkg/version/version.go

@@ -37,6 +37,11 @@ func (v Version) compareTo(other Version) int {
 	return 0
 }
 
+// String returns the version string
+func (v Version) String() string {
+	return string(v)
+}
+
 // LessThan checks if a version is less than another
 func (v Version) LessThan(other Version) bool {
 	return v.compareTo(other) == -1