Skip to content

Commit

Permalink
translated error messages from italian to english
Browse files Browse the repository at this point in the history
  • Loading branch information
kopolindo committed Apr 2, 2018
1 parent 2c80104 commit cba9c37
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions db/populate.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func OpenDB() *sql.DB {
//Open db file
cveDB, err_opening := sql.Open("sqlite3", database)
if err_opening != nil {
fmt.Println("ERRORE IN FASE DI APERTURA:")
fmt.Println("Opening error:")
panic(err_opening)
}
return cveDB
Expand Down Expand Up @@ -82,7 +82,6 @@ func UnmarshalNIST() []CveRecord {
err = d.Decode(&cve)
_panic(err)
out = append(out, cve)
//fmt.Println("CveID: ", cve.Id, " Desc: ", cve.Description, " Refs: ", cve.Refs, " CvssV2Vector: ", cve.Cvssv2, " CvssV2Score: ", cve.Cvssv2score) //.Id, " DESCRIPTION: ", c.Description)*/
f.Close()
}
return out
Expand Down Expand Up @@ -117,7 +116,6 @@ func Insert(cveDB *sql.DB, params []string) {
querySw.Exec(params[0], params[1], params[2])
case 5:
queryCve, _ := cveDB.Prepare("INSERT OR IGNORE INTO cve (id, cve,cve_description,refs,cvssv2) VALUES (?, ?, ?, ?, ?)")
fmt.Println("UPDATING:", params[0], "-->", params[1])
queryCve.Exec(params[0], params[1], params[2], params[3], params[4])
case 7:
queryCve, _ := cveDB.Prepare("INSERT OR IGNORE INTO cve (id,cve_description,cwe,cwe_description,refs,cvssv2,cvssv3) VALUES (?, ?, ?, ?, ?, ?, ?)")
Expand All @@ -129,7 +127,6 @@ func CveSearch(cve string) Results {
var out Results
db := OpenDB()
var field Fields
fmt.Println("Looking for: ", cve)
// query
rows, err := db.Query("SELECT cve.cve,cve.cve_description,cve.cwe,cve.cwe_description,cve.refs,cve.cvssv2,cve.cvssv3,sw.software,sw.version FROM cve join sw on cve.cve = sw.id where cve.id = ?", cve)
if err != nil {
Expand Down Expand Up @@ -166,7 +163,6 @@ func SwSerch(sw string) []Results {
out Results
)
db := OpenDB()
fmt.Println("Looking for: ", sw)
// query
rows, err := db.Query(`SELECT cve.cve,cve.cve_description,sw.software,sw.version,cve.cwe,cve.cwe_description,cve.cvssv2,cve.cvssv3 FROM cve join sw on cve.cve = sw.id where sw.software like ?`, strings.Join([]string{"%", sw, "%"}, ""))
if err != nil {
Expand Down Expand Up @@ -200,7 +196,6 @@ func SwVSerch(sw string, ver string) []Results {
query = "SELECT cve.cve,sw.software,sw.version,cve.cwe,cve.cwe_description,cve.cvssv3 FROM cve join sw on cve.cve = sw.id where sw.software like ? and (sw.version like ?)"
software := strings.Join([]string{"%", sw, "%"}, "")
var version, searchCase string
fmt.Println("Looking for:", sw, "v", ver)
db := OpenDB()
var (
field Fields
Expand Down Expand Up @@ -257,10 +252,10 @@ func SwVSerch(sw string, ver string) []Results {
}
}
if len(versions[1]) == 0 {
fmt.Println("non ci sono versioni più recenti di ", ver)
fmt.Println("There is no version newer then ", ver)
}
if len(versions[1]) != 0 {
fmt.Println("le versioni più recenti di", ver, "sono", versions[k:])
fmt.Println("Versions newer then ", ver, "are", versions[k:])
}
}
if searchCase == "e" {
Expand Down Expand Up @@ -330,8 +325,6 @@ func UpdateTable() {
if err != nil {
fmt.Println("ERROR UPDATING ", err)
}
fmt.Println("UPDATED ", updateCVE[i], "-->", updateID[i])

}
if rows.Err() != nil {
fmt.Println(rows.Err())
Expand All @@ -346,7 +339,7 @@ func Populate() {
//Open db file
cveDB, err_opening := sql.Open("sqlite3", database)
if err_opening != nil {
fmt.Println("ERRORE IN FASE DI APERTURA:")
fmt.Println("Opening error:")
panic(err_opening)
}
//Assign to cweList the complete list of weaknesses
Expand Down

0 comments on commit cba9c37

Please sign in to comment.