diff options
author | Cameron Moore <moorereason@gmail.com> | 2018-09-06 13:34:29 -0500 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-09-07 08:25:51 +0200 |
commit | c8ce65046dc7539f3bf5f6dd35fa7ece2bec866d (patch) | |
tree | 5ad66c0ddc6db67a65f386fbdd0b4bfdb0fb6871 /helpers/hugo.go | |
parent | a53f962312e273cea9fe460b40655350a82210f2 (diff) |
helpers: Fix golint issues
helpers/general.go:448:1: comment on exported function DiffStrings should be of the form "DiffStrings ..."
helpers/hugo.go:42:6: exported type HugoVersionString should have comment or be unexported
helpers/hugo.go:48:1: exported method HugoVersion.Version should have comment or be unexported
helpers/hugo.go:56:1: comment on exported method HugoVersionString.Compare should be of the form "Compare ..."
helpers/hugo.go:62:1: comment on exported method HugoVersionString.Eq should be of the form "Eq ..."
helpers/path.go:548:1: comment on exported function OpenFilesForWriting should be of the form "OpenFilesForWriting ..."
helpers/processing_stats.go:24:6: exported type ProcessingStats should have comment or be unexported
helpers/processing_stats.go:55:1: exported function NewProcessingStats should have comment or be unexported
helpers/processing_stats.go:59:1: exported method ProcessingStats.Incr should have comment or be unexported
helpers/processing_stats.go:63:1: exported method ProcessingStats.Add should have comment or be unexported
helpers/processing_stats.go:67:1: exported method ProcessingStats.Table should have comment or be unexported
helpers/processing_stats.go:83:1: exported function ProcessingStatsTable should have comment or be unexported
Diffstat (limited to 'helpers/hugo.go')
-rw-r--r-- | helpers/hugo.go | 10 |
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 { |