test(github): use require

This commit is contained in:
knqyf263
2019-11-10 15:50:23 +02:00
parent 51eb0dd362
commit 93c7b5e248

View File

@@ -13,6 +13,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/stretchr/testify/require"
"github.com/aquasecurity/trivy/pkg/log" "github.com/aquasecurity/trivy/pkg/log"
"golang.org/x/xerrors" "golang.org/x/xerrors"
@@ -409,9 +411,8 @@ func TestClient_DownloadDB(t *testing.T) {
}, },
} }
if err := log.InitLogger(false, true); err != nil { err := log.InitLogger(false, true)
panic(err) require.NoError(t, err, "Init logger failed")
}
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path { switch r.URL.Path {