Improve sort logics

This commit is contained in:
Kota Kanbe
2017-05-05 13:14:21 +09:00
committed by kota kanbe
parent 509fb045b6
commit 2e37d3adc1
7 changed files with 54 additions and 221 deletions

View File

@@ -21,7 +21,6 @@ import (
"encoding/json"
"fmt"
"net/http"
"sort"
"time"
"github.com/cenkalti/backoff"
@@ -69,7 +68,6 @@ type response struct {
CveDetail cve.CveDetail
}
//TODO rename to FetchCveDictionary
func (api cvedictClient) FetchCveDetails(cveIDs []string) (cveDetails cve.CveDetails, err error) {
switch config.Conf.CveDBType {
case "sqlite3", "mysql", "postgres":
@@ -130,7 +128,8 @@ func (api cvedictClient) FetchCveDetails(cveIDs []string) (cveDetails cve.CveDet
fmt.Errorf("Failed to fetch CVE. err: %v", errs)
}
sort.Sort(cveDetails)
//TODO
// sort.Sort(cveDetails)
return
}
@@ -158,8 +157,9 @@ func (api cvedictClient) FetchCveDetailsFromCveDB(cveIDs []string) (cveDetails c
}
}
//TODO
// order by CVE ID desc
sort.Sort(cveDetails)
// sort.Sort(cveDetails)
return
}