refactor: clean code

This commit is contained in:
Fu Diwei
2024-11-01 15:56:22 +08:00
parent 1dee14e32d
commit 6b5580a30c
6 changed files with 14 additions and 14 deletions

View File

@@ -29,7 +29,7 @@ type AliyunSLBUploader struct {
}
func New(config *AliyunSLBUploaderConfig) (*AliyunSLBUploader, error) {
client, err := (&AliyunSLBUploader{}).createSdkClient(
client, err := createSdkClient(
config.AccessKeyId,
config.AccessKeySecret,
config.Region,
@@ -102,7 +102,7 @@ func (u *AliyunSLBUploader) Upload(ctx context.Context, certPem string, privkeyP
}, nil
}
func (u *AliyunSLBUploader) createSdkClient(accessKeyId, accessKeySecret, region string) (*aliyunSlb.Client, error) {
func createSdkClient(accessKeyId, accessKeySecret, region string) (*aliyunSlb.Client, error) {
if region == "" {
region = "cn-hangzhou" // SLB 服务默认区域:华东一杭州
}