Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Minor fix to convert to lowercase, fix error response
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Sep 10, 2020
1 parent 826b935 commit 8706482
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
const (

// version is the current version
version = "v0.4.0"
version = "v0.4.1"

// defaultUserAgent is the default user agent for all requests
defaultUserAgent string = "go-polynym: " + version
Expand Down
2 changes: 1 addition & 1 deletion client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestNewClient(t *testing.T) {
func ExampleNewClient() {
client := NewClient(nil)
fmt.Println(client.UserAgent)
// Output:go-polynym: v0.4.0
// Output:go-polynym: v0.4.1
}

// BenchmarkNewClient benchmarks the NewClient method
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ github.com/afex/hystrix-go v0.0.0-20180209013831-27fae8d30f1a/go.mod h1:SkGFH1ia
github.com/cactus/go-statsd-client/statsd v0.0.0-20200423205355-cb0885a1018c/go.mod h1:l/bIBLeOl9eX+wxJAzxS4TveKRtAqlyDpHjhkfO0MEI=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gojektech/heimdall/v6 v6.1.0 h1:M9L1xryMKGWUlAA33D0r0BaKiXWzvuReltDPPkC5loM=
github.com/gojektech/heimdall/v6 v6.1.0/go.mod h1:8g/ohsh0GXn8fzOf+qVrjX5pQLf7qQy8vEBjBUJ/9L4=
Expand Down
4 changes: 2 additions & 2 deletions polynym.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func GetAddress(client Client, handleOrPaymail string) (response *GetAddressResp
if len(response.ErrorMessage) == 0 {
response.ErrorMessage = "unknown error resolving address"
}
err = fmt.Errorf("error: %s", response.ErrorMessage)
err = fmt.Errorf("%s", response.ErrorMessage)
} else {
err = fmt.Errorf("bad response from polynym: %d", resp.StatusCode)
}
Expand All @@ -104,7 +104,7 @@ func GetAddress(client Client, handleOrPaymail string) (response *GetAddressResp
// HandCashConvert now converts $handle to paymail: [email protected]
func HandCashConvert(handle string) string {
if strings.HasPrefix(handle, "$") {
return strings.Replace(handle, "$", "", -1) + "@handcash.io"
return strings.ToLower(strings.Replace(handle, "$", "", -1)) + "@handcash.io"
}
return handle
}

0 comments on commit 8706482

Please sign in to comment.