Merge pull request #14280 from falser101/fix/zjf

fix: code cleanup
This commit is contained in:
Benjamin Wang 2022-07-27 07:20:43 +08:00 committed by GitHub
commit fae4650834
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -236,7 +236,7 @@ func (t *tokenSimple) isValidSimpleToken(ctx context.Context, token string) bool
}
select {
case <-t.indexWaiter(uint64(index)):
case <-t.indexWaiter(index):
return true
case <-ctx.Done():
}

View File

@ -87,7 +87,7 @@ func TestNewAuthStoreBcryptCost(t *testing.T) {
func encodePassword(s string) string {
hashedPassword, _ := bcrypt.GenerateFromPassword([]byte(s), bcrypt.MinCost)
return base64.StdEncoding.EncodeToString([]byte(hashedPassword))
return base64.StdEncoding.EncodeToString(hashedPassword)
}
func setupAuthStore(t *testing.T) (store *authStore, teardownfunc func(t *testing.T)) {

View File

@ -48,6 +48,7 @@ import (
"golang.org/x/net/http2"
"golang.org/x/net/trace"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
type serveCtx struct {
@ -137,7 +138,7 @@ func (sctx *serveCtx) serve(
var gwmux *gw.ServeMux
if s.Cfg.EnableGRPCGateway {
gwmux, err = sctx.registerGateway([]grpc.DialOption{grpc.WithInsecure()})
gwmux, err = sctx.registerGateway([]grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())})
if err != nil {
sctx.lg.Error("registerGateway failed", zap.Error(err))
return err