| // Copyright 2021 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| package audit |
| |
| import ( |
| "golang.org/x/vulndb/osv" |
| |
| "golang.org/x/vulndb/client" |
| ) |
| |
| // LoadVulnerabilities fetches vulnerabilities for pkgs in dbs. Currently, |
| // no caching is enabled. |
| // TODO: add cache support once it is amenable to side-effect free testing. |
| func LoadVulnerabilities(dbs []string, pkgs []string) ([]*osv.Entry, error) { |
| dbClient, err := client.NewClient(dbs, client.Options{}) |
| if err != nil { |
| return nil, err |
| } |
| return dbClient.Get(pkgs) |
| } |