Merge pull request #574 from hongli-my/fix-nvd-path
not use path.Join, stop clair, left nvd xml like nvd-data3260521972007.xml
This commit is contained in:
commit
3babbafb2f
@ -26,6 +26,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -146,7 +147,7 @@ func getDataFeeds(dataFeedHashes map[string]string, localPath string) (map[strin
|
|||||||
// Create io.Reader for every data feed.
|
// Create io.Reader for every data feed.
|
||||||
dataFeedReaders := make(map[string]NestedReadCloser)
|
dataFeedReaders := make(map[string]NestedReadCloser)
|
||||||
for _, dataFeedName := range dataFeedNames {
|
for _, dataFeedName := range dataFeedNames {
|
||||||
fileName := localPath + dataFeedName + ".xml"
|
fileName := filepath.Join(localPath, fmt.Sprintf("%s.xml", dataFeedName))
|
||||||
|
|
||||||
if h, ok := dataFeedHashes[dataFeedName]; ok && h == dataFeedHashes[dataFeedName] {
|
if h, ok := dataFeedHashes[dataFeedName]; ok && h == dataFeedHashes[dataFeedName] {
|
||||||
// The hash is known, the disk should contains the feed. Try to read from it.
|
// The hash is known, the disk should contains the feed. Try to read from it.
|
||||||
|
Loading…
Reference in New Issue
Block a user