Skip to content

Commit 9454132

Browse files
committed
fix: Resolved the issue where the region information check failed during resource creation for endpoints with the suffix -control.
1 parent ea00a36 commit 9454132

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change log
22

3+
## 1.0.10
4+
- Resolved the issue where the region information check failed during resource creation for endpoints with the suffix `-control`.
5+
36
## 1.0.9
47
- Fix the error [issue#26](https://github.com/aliyun/aliyun-mns-go-sdk/issues/26) where the StsTokenCredential component in the credentials package does not exist.
58

README-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Aliyun MNS Go SDK
22

3-
[![Github version](https://badgen.net/badge/color/1.0.9/green?label=version)](https://badgen.net/badge/color/1.0.9/green?label=version)
3+
[![Github version](https://badgen.net/badge/color/1.0.10/green?label=version)](https://badgen.net/badge/color/1.0.10/green?label=version)
44

55
Aliyun MNS Go SDK 是 MNS 在 Go 编译语言的官方 SDK
66

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Aliyun MNS Go SDK
22

3-
[![Github version](https://badgen.net/badge/color/1.0.9/green?label=version)](https://badgen.net/badge/color/1.0.9/green?label=version)
3+
[![Github version](https://badgen.net/badge/color/1.0.10/green?label=version)](https://badgen.net/badge/color/1.0.10/green?label=version)
44

55
The Aliyun MNS Go SDK is the official SDK for MNS in the Go programming language
66

client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"net/http"
1010
neturl "net/url"
1111
"os"
12+
"regexp"
1213
"runtime"
1314
"strings"
1415
"sync"
@@ -185,7 +186,8 @@ func NewAliMNSClientWithConfig(clientConfig AliMNSClientConfig) MNSClient {
185186

186187
accountIdSlice := strings.Split(pieces[0], "/")
187188
cli.accountId = accountIdSlice[len(accountIdSlice)-1]
188-
regionSlice := strings.Split(pieces[2], "-internal")
189+
re := regexp.MustCompile("-(internal|control)")
190+
regionSlice := re.Split(pieces[2], -1)
189191
cli.region = regionSlice[0]
190192
if globalUrl := os.Getenv(GlobalProxy); globalUrl != "" {
191193
cli.proxyURL = globalUrl

version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ package ali_mns
22

33
const (
44
SdkName = "aliyun-sdk-go"
5-
Version = "1.0.9"
5+
Version = "1.0.10"
66
)

0 commit comments

Comments
 (0)