Skip to content
This repository has been archived by the owner on Mar 20, 2022. It is now read-only.

Commit

Permalink
Remove sort function
Browse files Browse the repository at this point in the history
  • Loading branch information
spiegel-im-spiegel committed Mar 23, 2018
1 parent f182725 commit 73006da
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19,121 deletions.
6 changes: 6 additions & 0 deletions cli/vulnlist/main.go
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
"sort"
"time"

"github.com/spiegel-im-spiegel/go-myjvn"
Expand Down Expand Up @@ -91,6 +92,11 @@ func run(start, end time.Time) {
}
}
if vulnInfo != nil {
//sort by DateLastUpdated
sort.Slice(vulnInfo.Vulinfo, func(i int, j int) bool {
return vulnInfo.Vulinfo[i].VulinfoData.DateLastUpdated.Before(vulnInfo.Vulinfo[j].VulinfoData.DateLastUpdated.Time)
})
//encode to JSON
json, err := vulnInfo.JSON("")
if err != nil {
fmt.Fprintln(os.Stderr, err)
Expand Down

0 comments on commit 73006da

Please sign in to comment.