diff --git a/transport/v1/http/transport.go b/transport/v1/http/transport.go index cd28b6f..f83061d 100644 --- a/transport/v1/http/transport.go +++ b/transport/v1/http/transport.go @@ -10,12 +10,13 @@ type Transport struct { apiKey string // apiKey } +// args 0: sm4Key, 1: apiKey func NewTransport(env enum.Env, args ...string) *Transport { var sm4Key, apiKey string - if len(args) > 1 { + if len(args) > 0 { sm4Key = args[0] } - if len(args) > 2 { + if len(args) > 1 { apiKey = args[1] } return &Transport{