This commit is contained in:
Kota Kanbe
2017-05-31 20:42:20 +09:00
committed by kota kanbe
parent a14810bbd4
commit c6ad9ea57a
7 changed files with 210 additions and 406 deletions

View File

@@ -136,6 +136,18 @@ func Truncate(str string, length int) string {
return str
}
// Distinct a slice
func Distinct(ss []string) (distincted []string) {
m := map[string]bool{}
for _, s := range ss {
if _, found := m[s]; !found {
m[s] = true
distincted = append(distincted, s)
}
}
return
}
// VendorLink returns a URL of the given OS family and CVEID
//TODO
// func VendorLink(family, cveID string) string {