Fix gosimple checks

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Signed-off-by: Wang Yan <wangyan@vmware.com>
This commit is contained in:
Derek McGowan 2020-03-18 15:02:24 -07:00 committed by Wang Yan
parent 89e6568e34
commit 09109ab50a
5 changed files with 7 additions and 8 deletions

View file

@ -466,7 +466,7 @@ func TestEndpointAuthorizeTokenBasic(t *testing.T) {
}, },
}) })
authenicate1 := fmt.Sprintf("Basic realm=localhost") authenicate1 := "Basic realm=localhost"
basicCheck := func(a string) bool { basicCheck := func(a string) bool {
return a == fmt.Sprintf("Basic %s", basicAuth(username, password)) return a == fmt.Sprintf("Basic %s", basicAuth(username, password))
} }
@ -546,7 +546,7 @@ func TestEndpointAuthorizeTokenBasicWithExpiresIn(t *testing.T) {
}, },
}) })
authenicate1 := fmt.Sprintf("Basic realm=localhost") authenicate1 := "Basic realm=localhost"
tokenExchanges := 0 tokenExchanges := 0
basicCheck := func(a string) bool { basicCheck := func(a string) bool {
tokenExchanges = tokenExchanges + 1 tokenExchanges = tokenExchanges + 1
@ -706,7 +706,7 @@ func TestEndpointAuthorizeTokenBasicWithExpiresInAndIssuedAt(t *testing.T) {
}, },
}) })
authenicate1 := fmt.Sprintf("Basic realm=localhost") authenicate1 := "Basic realm=localhost"
tokenExchanges := 0 tokenExchanges := 0
basicCheck := func(a string) bool { basicCheck := func(a string) bool {
tokenExchanges = tokenExchanges + 1 tokenExchanges = tokenExchanges + 1
@ -835,7 +835,7 @@ func TestEndpointAuthorizeBasic(t *testing.T) {
username := "user1" username := "user1"
password := "funSecretPa$$word" password := "funSecretPa$$word"
authenicate := fmt.Sprintf("Basic realm=localhost") authenicate := "Basic realm=localhost"
validCheck := func(a string) bool { validCheck := func(a string) bool {
return a == fmt.Sprintf("Basic %s", basicAuth(username, password)) return a == fmt.Sprintf("Basic %s", basicAuth(username, password))
} }

View file

@ -8,7 +8,7 @@ import (
"github.com/docker/distribution" "github.com/docker/distribution"
"github.com/docker/distribution/registry/api/errcode" "github.com/docker/distribution/registry/api/errcode"
"github.com/docker/distribution/registry/api/v2" v2 "github.com/docker/distribution/registry/api/v2"
"github.com/docker/distribution/testutil" "github.com/docker/distribution/testutil"
) )

View file

@ -22,7 +22,7 @@ import (
"github.com/docker/distribution/manifest/schema1" "github.com/docker/distribution/manifest/schema1"
"github.com/docker/distribution/reference" "github.com/docker/distribution/reference"
"github.com/docker/distribution/registry/api/errcode" "github.com/docker/distribution/registry/api/errcode"
"github.com/docker/distribution/registry/api/v2" v2 "github.com/docker/distribution/registry/api/v2"
"github.com/docker/distribution/testutil" "github.com/docker/distribution/testutil"
"github.com/docker/distribution/uuid" "github.com/docker/distribution/uuid"
"github.com/docker/libtrust" "github.com/docker/libtrust"

View file

@ -9,7 +9,7 @@ import (
dcontext "github.com/docker/distribution/context" dcontext "github.com/docker/distribution/context"
"github.com/docker/distribution/reference" "github.com/docker/distribution/reference"
"github.com/docker/distribution/registry/api/errcode" "github.com/docker/distribution/registry/api/errcode"
"github.com/docker/distribution/registry/api/v2" v2 "github.com/docker/distribution/registry/api/v2"
"github.com/docker/distribution/registry/storage" "github.com/docker/distribution/registry/storage"
"github.com/gorilla/handlers" "github.com/gorilla/handlers"
"github.com/opencontainers/go-digest" "github.com/opencontainers/go-digest"

View file

@ -9,5 +9,4 @@ if ! command -v git-validation; then
fi fi
verbosity="${DCO_VERBOSITY--v}" verbosity="${DCO_VERBOSITY--v}"
echo $COMMIT_RANGE
GIT_CHECK_EXCLUDE="./vendor:./script/validate/template" git-validation "$verbosity" -range "5b98226afefa11a06ef0c652af4995177c0efda0..HEAD" -run DCO,short-subject,dangling-whitespace GIT_CHECK_EXCLUDE="./vendor:./script/validate/template" git-validation "$verbosity" -range "5b98226afefa11a06ef0c652af4995177c0efda0..HEAD" -run DCO,short-subject,dangling-whitespace