go vet fixes

pull/8/head
Stephen Searles 7 years ago
parent e6735a3ecc
commit ecb8351ef8
  1. 4
      caddyhugo.go
  2. 3
      content.go

@ -58,7 +58,7 @@ func (ch *CaddyHugo) Build() error {
return nil return nil
} }
func (ch CaddyHugo) BasePath() string { func (ch *CaddyHugo) BasePath() string {
return "/hugo" return "/hugo"
} }
@ -82,7 +82,7 @@ func (ch *CaddyHugo) Publish() error {
return nil return nil
} }
func (ch CaddyHugo) TmplData(r *http.Request, docref *docref) interface{} { func (ch *CaddyHugo) TmplData(r *http.Request, docref *docref) interface{} {
var doc *acedoc.Document var doc *acedoc.Document
if docref != nil { if docref != nil {
doc = docref.doc doc = docref.doc

@ -79,7 +79,7 @@ func GetContent(siteRoot string, sites *hugolib.HugoSites) ([]Content, error) {
// If ctype is empty string, "default" is used. The return value is the filename, // If ctype is empty string, "default" is used. The return value is the filename,
// which may be modified from the title and includes the content type if other than // which may be modified from the title and includes the content type if other than
// default, but does not include the full directory relative to the site. // default, but does not include the full directory relative to the site.
func (ch CaddyHugo) NewContent(name, ctype string) (string, error) { func (ch *CaddyHugo) NewContent(name, ctype string) (string, error) {
if filepath.Ext(name) != ".md" { if filepath.Ext(name) != ".md" {
name += ".md" name += ".md"
} }
@ -101,7 +101,6 @@ func (ch CaddyHugo) NewContent(name, ctype string) (string, error) {
out, err := cmd.CombinedOutput() out, err := cmd.CombinedOutput()
if err != nil { if err != nil {
return filename, fmt.Errorf("error running 'hugo new': %v; %v", err, string(out)) return filename, fmt.Errorf("error running 'hugo new': %v; %v", err, string(out))
return filename, err
} }
} }

Loading…
Cancel
Save