mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-09 19:47:02 +02:00
all: Apply staticcheck recommendations
This commit is contained in:
@@ -58,8 +58,8 @@ func TestChaingMultipleTransformers(t *testing.T) {
|
||||
|
||||
expected := "Test: f4r f3r f1r f2r f1r The End."
|
||||
|
||||
if string(out.Bytes()) != expected {
|
||||
t.Errorf("Expected %s got %s", expected, string(out.Bytes()))
|
||||
if out.String() != expected {
|
||||
t.Errorf("Expected %s got %s", expected, out.String())
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -35,7 +35,7 @@ func doTestLiveReloadInject(t *testing.T, bodyEndTag string) {
|
||||
tr.Apply(out, in)
|
||||
|
||||
expected := fmt.Sprintf(`<script data-no-instant>document.write('<script src="/livereload.js?port=1313&mindelay=10"></' + 'script>')</script>%s`, bodyEndTag)
|
||||
if string(out.Bytes()) != expected {
|
||||
t.Errorf("Expected %s got %s", expected, string(out.Bytes()))
|
||||
if out.String() != expected {
|
||||
t.Errorf("Expected %s got %s", expected, out.String())
|
||||
}
|
||||
}
|
||||
|
@@ -37,8 +37,6 @@ type absurllexer struct {
|
||||
quotes [][]byte
|
||||
}
|
||||
|
||||
type stateFunc func(*absurllexer) stateFunc
|
||||
|
||||
type prefix struct {
|
||||
disabled bool
|
||||
b []byte
|
||||
@@ -54,11 +52,6 @@ func newPrefixState() []*prefix {
|
||||
}
|
||||
}
|
||||
|
||||
type absURLMatcher struct {
|
||||
match []byte
|
||||
quote []byte
|
||||
}
|
||||
|
||||
func (l *absurllexer) emit() {
|
||||
l.w.Write(l.content[l.start:l.pos])
|
||||
l.start = l.pos
|
||||
|
@@ -41,7 +41,6 @@ const (
|
||||
replace1 = "No replacements."
|
||||
replace2 = "ᚠᛇᚻ ᛒᛦᚦ ᚠᚱᚩᚠᚢᚱ\nᚠᛁᚱᚪ ᚷᛖᚻᚹᛦᛚᚳᚢᛗ"
|
||||
replace3 = `End of file: src="/`
|
||||
replace4 = `End of file: srcset="/`
|
||||
replace5 = `Srcsett with no closing quote: srcset="/img/small.jpg do be do be do.`
|
||||
|
||||
// Issue: 816, schemaless links combined with others
|
||||
|
Reference in New Issue
Block a user