mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-29 15:10:35 +03: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:
parent
00f07c5374
commit
67df33f500
33 changed files with 310 additions and 303 deletions
|
@ -6,11 +6,11 @@ import (
|
|||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
func TestFixUrl(t *testing.T) {
|
||||
func TestFixURL(t *testing.T) {
|
||||
type data struct {
|
||||
TestName string
|
||||
CliBaseUrl string
|
||||
CfgBaseUrl string
|
||||
CLIBaseURL string
|
||||
CfgBaseURL string
|
||||
AppendPort bool
|
||||
Port int
|
||||
Result string
|
||||
|
@ -28,11 +28,11 @@ func TestFixUrl(t *testing.T) {
|
|||
}
|
||||
|
||||
for i, test := range tests {
|
||||
BaseUrl = test.CliBaseUrl
|
||||
viper.Set("BaseUrl", test.CfgBaseUrl)
|
||||
BaseURL = test.CLIBaseURL
|
||||
viper.Set("BaseURL", test.CfgBaseURL)
|
||||
serverAppend = test.AppendPort
|
||||
serverPort = test.Port
|
||||
result, err := fixUrl(BaseUrl)
|
||||
result, err := fixURL(BaseURL)
|
||||
if err != nil {
|
||||
t.Errorf("Test #%d %s: unexpected error %s", i, test.TestName, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue