mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
fix: close sql driver after testing sqlite availability (#2922)
Signed-off-by: William Tang <ttc0419@outlook.com>
This commit is contained in:
parent
8a7f08e2c8
commit
fe0b78b7fe
@ -48,6 +48,10 @@ func NewArchiveCataloger() pkg.Cataloger {
|
||||
}
|
||||
|
||||
func isSqliteDriverAvailable() bool {
|
||||
_, err := sql.Open("sqlite", ":memory:")
|
||||
return err == nil
|
||||
db, err := sql.Open("sqlite", ":memory:")
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
_ = db.Close()
|
||||
return true
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user