mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-28 22:39:05 +08:00
Fixing megacheck issues reported by gometalinter
This commit is contained in:
@@ -26,7 +26,7 @@ func main() {
|
||||
}
|
||||
for _, d := range dirs {
|
||||
path := "_repos/src/" + f.Name() + "/" + d.Name()
|
||||
if time.Now().Sub(d.ModTime()) > 30*24*time.Hour {
|
||||
if time.Since(d.ModTime()) > 30*24*time.Hour {
|
||||
if *real {
|
||||
log.Printf("Deleting %s (repo is old)...", path)
|
||||
os.RemoveAll(path)
|
||||
|
||||
@@ -56,12 +56,7 @@ func deleteRepo(repo string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
err = mb.Put([]byte("scores"), scoreBytes)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return mb.Put([]byte("scores"), scoreBytes)
|
||||
})
|
||||
|
||||
}
|
||||
@@ -110,7 +105,7 @@ func listDuplicates() error {
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
if *repo == "" && *listDupes == false {
|
||||
if *repo == "" && !*listDupes {
|
||||
log.Println("Usage: manage_db.go [-list-duplicates] [-remove repo]")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -75,12 +75,7 @@ func main() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = mb.Put([]byte("scores"), scoreBytes)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return mb.Put([]byte("scores"), scoreBytes)
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
||||
@@ -10,10 +10,7 @@ import (
|
||||
"github.com/gojp/goreportcard/handlers"
|
||||
)
|
||||
|
||||
const (
|
||||
repoBucket string = "repos"
|
||||
metaBucket string = "meta"
|
||||
)
|
||||
const repoBucket = "repos"
|
||||
|
||||
type checksResp struct {
|
||||
Repo string `json:"repo"`
|
||||
|
||||
Reference in New Issue
Block a user