mirror of
https://codeberg.org/readeck/readeck.git
synced 2025-12-22 13:17:10 +00:00
Applied perfsprint linter
- concatenate simple sprint calls - use errors.New when possible - use strconv for "%d" or "%x" sprint calls
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
figure "github.com/mangoumbrella/goldmark-figure"
|
||||
@@ -199,7 +200,7 @@ func getEtag(name string, src ...io.Reader) string {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
return fmt.Sprintf("%x", h.Sum64())
|
||||
return strconv.FormatUint(h.Sum64(), 16)
|
||||
}
|
||||
|
||||
func newManifest(fileList []*File) (*Manifest, error) {
|
||||
|
||||
@@ -224,7 +224,7 @@ var lineRE = regexp.MustCompile(`^(.+?)(?:\((.+)\))?:\s*(.*)$`)
|
||||
|
||||
func parseLine(line string) ([3]string, error) {
|
||||
if !lineRE.MatchString(line) {
|
||||
return [3]string{}, fmt.Errorf("Cannot parse line")
|
||||
return [3]string{}, errors.New("Cannot parse line")
|
||||
}
|
||||
|
||||
m := lineRE.FindAllStringSubmatch(line, -1)
|
||||
|
||||
Reference in New Issue
Block a user