mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-29 06:49:05 +08:00
lowercase err strings
This commit is contained in:
@@ -18,7 +18,7 @@ func getFromCache(repo string) (checksResp, error) {
|
||||
// try and fetch from boltdb
|
||||
db, err := bolt.Open(DBPath, 0600, &bolt.Options{Timeout: 1 * time.Second})
|
||||
if err != nil {
|
||||
return checksResp{}, fmt.Errorf("Failed to open bolt database during GET: %v", err)
|
||||
return checksResp{}, fmt.Errorf("failed to open bolt database during GET: %v", err)
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
@@ -132,16 +132,16 @@ func newChecksResp(repo string, forceRefresh bool) (checksResp, error) {
|
||||
// fetch the repo and grade it
|
||||
err := clone(url)
|
||||
if err != nil {
|
||||
return checksResp{}, fmt.Errorf("Could not clone repo: %v", err)
|
||||
return checksResp{}, fmt.Errorf("could not clone repo: %v", err)
|
||||
}
|
||||
|
||||
dir := dirName(url)
|
||||
filenames, err := check.GoFiles(dir)
|
||||
if err != nil {
|
||||
return checksResp{}, fmt.Errorf("Could not get filenames: %v", err)
|
||||
return checksResp{}, fmt.Errorf("could not get filenames: %v", err)
|
||||
}
|
||||
if len(filenames) == 0 {
|
||||
return checksResp{}, fmt.Errorf("No .go files found")
|
||||
return checksResp{}, fmt.Errorf("no .go files found")
|
||||
}
|
||||
checks := []check.Check{
|
||||
check.GoFmt{Dir: dir, Filenames: filenames},
|
||||
|
||||
@@ -35,7 +35,7 @@ func HighScoresHandler(w http.ResponseWriter, r *http.Request) {
|
||||
err = db.View(func(tx *bolt.Tx) error {
|
||||
hsb := tx.Bucket([]byte(MetaBucket))
|
||||
if hsb == nil {
|
||||
return fmt.Errorf("High score bucket not found")
|
||||
return fmt.Errorf("high score bucket not found")
|
||||
}
|
||||
scoreBytes := hsb.Get([]byte("scores"))
|
||||
if scoreBytes == nil {
|
||||
|
||||
Reference in New Issue
Block a user