mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
Correct initialisms as suggested by golint
First step to use initialisms that golint suggests,
for example:
Line 116: func GetHtmlRenderer should be GetHTMLRenderer
as see on http://goreportcard.com/report/spf13/hugo
Thanks to @bep for the idea!
Note that command-line flags (cobra and pflag)
as well as struct fields like .BaseUrl and .Url
that are used in Go HTML templates need more work
to maintain backward-compatibility, and thus
are NOT yet dealt with in this commit.
First step in fixing #959.
This commit is contained in:
@@ -16,7 +16,7 @@ type PagePublisher interface {
|
||||
}
|
||||
|
||||
type PagePub struct {
|
||||
UglyUrls bool
|
||||
UglyURLs bool
|
||||
DefaultExtension string
|
||||
PublishDir string
|
||||
}
|
||||
@@ -46,7 +46,7 @@ func (pp *PagePub) Translate(src string) (dest string, err error) {
|
||||
dir = filepath.Join(pp.PublishDir, dir)
|
||||
}
|
||||
|
||||
if pp.UglyUrls || file == "index.html" || file == "404.html" {
|
||||
if pp.UglyURLs || file == "index.html" || file == "404.html" {
|
||||
return filepath.Join(dir, fmt.Sprintf("%s%s", name, ext)), nil
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ func TestTranslateUglyUrls(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
f := &PagePub{UglyUrls: true}
|
||||
f := &PagePub{UglyURLs: true}
|
||||
dest, err := f.Translate(filepath.FromSlash(test.content))
|
||||
if err != nil {
|
||||
t.Fatalf("Translate returned an unexpected err: %s", err)
|
||||
|
||||
Reference in New Issue
Block a user