More initialism corrections (golint)

Thanks to @bep's new, brilliant helpers.Deprecated() function,
the following functions or variables are transitioned to their
new names, preserving backward compatibility for v0.14
and warning the user of upcoming obsolescence in v0.15:

 * .Url → .URL (for node, menu and paginator)
 * .Site.BaseUrl → .Site.BaseURL
 * .Site.Indexes → .Site.Taxonomies
 * .Site.Recent → .Site.Pages
 * getJson → getJSON
 * getCsv → getCSV
 * safeHtml → safeHTML
 * safeCss → safeCSS
 * safeUrl → safeURL

Also fix related initialisms in strings and comments.

Continued effort in fixing #959.
This commit is contained in:
Anthony Fok
2015-03-17 22:16:54 -07:00
committed by bep
parent ca69cad8aa
commit 8b8fb417ae
20 changed files with 184 additions and 129 deletions

View File

@@ -999,10 +999,10 @@ func TestSafeHTML(t *testing.T) {
buf.Reset()
err = tmpl.Execute(buf, SafeHTML(this.str))
if err != nil {
t.Errorf("[%d] execute template with an escaped string value by SafeHtml returns unexpected error: %s", i, err)
t.Errorf("[%d] execute template with an escaped string value by SafeHTML returns unexpected error: %s", i, err)
}
if buf.String() != this.expectWithEscape {
t.Errorf("[%d] execute template with an escaped string value by SafeHtml, got %v but expected %v", i, buf.String(), this.expectWithEscape)
t.Errorf("[%d] execute template with an escaped string value by SafeHTML, got %v but expected %v", i, buf.String(), this.expectWithEscape)
}
}
}
@@ -1034,10 +1034,10 @@ func TestSafeHTMLAttr(t *testing.T) {
buf.Reset()
err = tmpl.Execute(buf, SafeHTMLAttr(this.str))
if err != nil {
t.Errorf("[%d] execute template with an escaped string value by SafeHtmlAttr returns unexpected error: %s", i, err)
t.Errorf("[%d] execute template with an escaped string value by SafeHTMLAttr returns unexpected error: %s", i, err)
}
if buf.String() != this.expectWithEscape {
t.Errorf("[%d] execute template with an escaped string value by SafeHtmlAttr, got %v but expected %v", i, buf.String(), this.expectWithEscape)
t.Errorf("[%d] execute template with an escaped string value by SafeHTMLAttr, got %v but expected %v", i, buf.String(), this.expectWithEscape)
}
}
}
@@ -1069,10 +1069,10 @@ func TestSafeCSS(t *testing.T) {
buf.Reset()
err = tmpl.Execute(buf, SafeCSS(this.str))
if err != nil {
t.Errorf("[%d] execute template with an escaped string value by SafeCss returns unexpected error: %s", i, err)
t.Errorf("[%d] execute template with an escaped string value by SafeCSS returns unexpected error: %s", i, err)
}
if buf.String() != this.expectWithEscape {
t.Errorf("[%d] execute template with an escaped string value by SafeCss, got %v but expected %v", i, buf.String(), this.expectWithEscape)
t.Errorf("[%d] execute template with an escaped string value by SafeCSS, got %v but expected %v", i, buf.String(), this.expectWithEscape)
}
}
}
@@ -1104,10 +1104,10 @@ func TestSafeURL(t *testing.T) {
buf.Reset()
err = tmpl.Execute(buf, SafeURL(this.str))
if err != nil {
t.Errorf("[%d] execute template with an escaped string value by SafeUrl returns unexpected error: %s", i, err)
t.Errorf("[%d] execute template with an escaped string value by SafeURL returns unexpected error: %s", i, err)
}
if buf.String() != this.expectWithEscape {
t.Errorf("[%d] execute template with an escaped string value by SafeUrl, got %v but expected %v", i, buf.String(), this.expectWithEscape)
t.Errorf("[%d] execute template with an escaped string value by SafeURL, got %v but expected %v", i, buf.String(), this.expectWithEscape)
}
}
}