refactor(go-vulndb): small refactoring (#185)

This commit is contained in:
DmitriyLewen 2022-11-23 17:34:51 +06:00 committed by GitHub
parent 3c40c660fd
commit f2c7cb0a4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,8 +2,6 @@ package govulndb
import (
"encoding/json"
"fmt"
"golang.org/x/xerrors"
"log"
"net/url"
"os"
@ -11,6 +9,8 @@ import (
"path/filepath"
"strings"
"golang.org/x/xerrors"
"github.com/aquasecurity/vuln-list-update/utils"
)
@ -126,7 +126,7 @@ func (c VulnDB) parseModuleEntries(baseURL *url.URL, moduleName string) ([]Entry
res, err := utils.FetchURL(pkgURL.String(), "", c.retry)
if err != nil {
if strings.Contains(err.Error(), notFoundError) {
log.Println(fmt.Sprintf("module %s not found", moduleName))
log.Printf("module %s not found", moduleName)
return nil, nil
}
return nil, xerrors.Errorf("unable to query %s advisory: %w", moduleName, err)