Skip to content

Commit

Permalink
Fix some quality issues, add .deepsource.toml
Browse files Browse the repository at this point in the history
Signed-off-by: Allen <allen@deepsource.io>
  • Loading branch information
Allen committed Feb 18, 2020
1 parent b426c1b commit 7c2d9d0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version = 1
test_patterns = [
"*_test.go"
]
exclude_patterns = [
"examples/**",
"vendor/**"
]
[[analyzers]]
name = "go"
enabled = true
[analyzers.meta]
import_path = "github.com/messagebird/sachet"
2 changes: 1 addition & 1 deletion cmd/sachet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func errorHandler(w http.ResponseWriter, status int, err error, provider string)
}
// respond json
bytes, _ := json.Marshal(data)
json := string(bytes[:])
json := string(bytes)
fmt.Fprint(w, json)

log.Println("Error: " + json)
Expand Down
2 changes: 1 addition & 1 deletion provider/aliyun/aliyun.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (aliyun *Aliyun) Send(message sachet.Message) error {
var response *dysmsapi.SendSmsResponse
response, err = aliyun.client.SendSms(request)
if err == nil && (!response.IsSuccess() || response.Code != "OK") {
err = fmt.Errorf(response.String())
return fmt.Errorf(response.String())
}
}
default:
Expand Down

0 comments on commit 7c2d9d0

Please sign in to comment.