From 81d583c1ec3337ba587a8447179a6d7a3055f1dc Mon Sep 17 00:00:00 2001 From: nikkiing <1031497516@qq.com> Date: Wed, 22 Mar 2023 16:29:37 +0800 Subject: [PATCH] NewTransport --- transport/v1/http/transport.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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{