Skip to content

Commit 7c2d9d0

Browse files
author
Allen
committed
Fix some quality issues, add .deepsource.toml
Signed-off-by: Allen <allen@deepsource.io>
1 parent b426c1b commit 7c2d9d0

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

.deepsource.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version = 1
2+
test_patterns = [
3+
"*_test.go"
4+
]
5+
exclude_patterns = [
6+
"examples/**",
7+
"vendor/**"
8+
]
9+
[[analyzers]]
10+
name = "go"
11+
enabled = true
12+
[analyzers.meta]
13+
import_path = "github.com/messagebird/sachet"

cmd/sachet/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func errorHandler(w http.ResponseWriter, status int, err error, provider string)
218218
}
219219
// respond json
220220
bytes, _ := json.Marshal(data)
221-
json := string(bytes[:])
221+
json := string(bytes)
222222
fmt.Fprint(w, json)
223223

224224
log.Println("Error: " + json)

provider/aliyun/aliyun.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (aliyun *Aliyun) Send(message sachet.Message) error {
5252
var response *dysmsapi.SendSmsResponse
5353
response, err = aliyun.client.SendSms(request)
5454
if err == nil && (!response.IsSuccess() || response.Code != "OK") {
55-
err = fmt.Errorf(response.String())
55+
return fmt.Errorf(response.String())
5656
}
5757
}
5858
default:

0 commit comments

Comments
 (0)