mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 22:21:07 +03:00
hugolib: apply some more Golint rules
This commit is contained in:
parent
5759007874
commit
e007c9b25d
6 changed files with 33 additions and 34 deletions
|
@ -125,7 +125,7 @@ func (sc shortcode) String() string {
|
|||
return fmt.Sprintf("%s(%q, %t){%s}", sc.name, params, sc.doMarkup, sc.inner)
|
||||
}
|
||||
|
||||
// all in one go: extract, render and replace
|
||||
// ShortcodesHandle does all in one go: extract, render and replace
|
||||
// only used for testing
|
||||
func ShortcodesHandle(stringToParse string, page *Page, t tpl.Template) string {
|
||||
tmpContent, tmpShortcodes := extractAndRenderShortcodes(stringToParse, page, t)
|
||||
|
@ -467,9 +467,8 @@ func replaceShortcodeTokens(source []byte, prefix string, wrapped bool, replacem
|
|||
|
||||
if val, ok := replacements[key]; ok {
|
||||
return []byte(val)
|
||||
} else {
|
||||
panic(fmt.Errorf("unknown shortcode token %q", key))
|
||||
}
|
||||
panic(fmt.Errorf("unknown shortcode token %q", key))
|
||||
})
|
||||
|
||||
return b, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue