summaryrefslogtreecommitdiffstats
path: root/helpers/hugo.go
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/hugo.go')
-rw-r--r--helpers/hugo.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/helpers/hugo.go b/helpers/hugo.go
index 4ec340e18..45c261fd0 100644
--- a/helpers/hugo.go
+++ b/helpers/hugo.go
@@ -39,27 +39,29 @@ var (
_ compare.Comparer = (*HugoVersionString)(nil)
)
-type HugoVersionString string
-
func (v HugoVersion) String() string {
return hugoVersion(v.Number, v.PatchLevel, v.Suffix)
}
+// Version returns the Hugo version.
func (v HugoVersion) Version() HugoVersionString {
return HugoVersionString(v.String())
}
+// HugoVersionString represents a Hugo version string.
+type HugoVersionString string
+
func (h HugoVersionString) String() string {
return string(h)
}
-// Implements compare.Comparer
+// Compare implements the compare.Comparer interface.
func (h HugoVersionString) Compare(other interface{}) int {
v := MustParseHugoVersion(h.String())
return compareVersionsWithSuffix(v.Number, v.PatchLevel, v.Suffix, other)
}
-// Implements compare.Eqer
+// Eq implements the compare.Eqer interface.
func (h HugoVersionString) Eq(other interface{}) bool {
s, err := cast.ToStringE(other)
if err != nil {