muffle some more errors
parent
34574c0713
commit
890e8e71be
8
main.go
8
main.go
|
@ -107,7 +107,7 @@ func getNews() (entries []newsEntry, err error) {
|
||||||
} else if kv[0] == "title" {
|
} else if kv[0] == "title" {
|
||||||
current.Title = strings.TrimSpace(kv[1])
|
current.Title = strings.TrimSpace(kv[1])
|
||||||
} else {
|
} else {
|
||||||
log.Printf("Ignoring unknown metadata in news entry: %v\n", newsLine)
|
log.Printf("ignoring unknown metadata in news entry: %v\n", newsLine)
|
||||||
}
|
}
|
||||||
if current.Pubdate != "" && current.Title != "" {
|
if current.Pubdate != "" && current.Title != "" {
|
||||||
inMeta = false
|
inMeta = false
|
||||||
|
@ -152,7 +152,6 @@ func pageTitleFor(username string) string {
|
||||||
}
|
}
|
||||||
content, err := ioutil.ReadFile(indexPath)
|
content, err := ioutil.ReadFile(indexPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("failed to read %q: %v\n", indexPath, err)
|
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
titleMatch := pageTitleRe.FindStringSubmatch(string(content))
|
titleMatch := pageTitleRe.FindStringSubmatch(string(content))
|
||||||
|
@ -181,7 +180,7 @@ func systemUsers() map[string]bool {
|
||||||
func mtimeFor(username string) int64 {
|
func mtimeFor(username string) int64 {
|
||||||
path := path.Join(homesDir(), username, "public_html")
|
path := path.Join(homesDir(), username, "public_html")
|
||||||
var maxMtime int64 = 0
|
var maxMtime int64 = 0
|
||||||
err := filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
|
_ = filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -190,9 +189,6 @@ func mtimeFor(username string) int64 {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
|
||||||
log.Printf("error walking %q: %v\n", path, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return maxMtime
|
return maxMtime
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue