Skip to content

Commit 35cc073

Browse files
authored
fixes for go 1.10 (#15)
1 parent c9cc931 commit 35cc073

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ branches:
55
only:
66
- master
77
go:
8-
- 1.9
9-
- master
8+
- "1.9"
9+
- "1.10"
10+
- "master"
1011
services:
1112
- redis-server
1213
matrix:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Status](https://travis-ci.org/brave-intl/bat-go.svg?branch=master)](https://trav
55

66
## Developer Setup
77

8-
1. [Install Go 1.9](https://golang.org/doc/install)
8+
1. [Install Go 1.10](https://golang.org/doc/install)
99

1010
2. Run `go get -d github.com/brave-intl/bat-go`.
1111

bin/create-tokens/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func main() {
7878
if len(*expiryDateStr) > 0 {
7979
expiryDate, err = time.Parse(dateFormat, *expiryDateStr)
8080
if err != nil {
81-
log.Fatalln("%s is not a valid ISO 8601 datetime", *expiryDateStr)
81+
log.Fatalf("%s is not a valid ISO 8601 datetime\n", *expiryDateStr)
8282
}
8383
} else {
8484
expiryDate = maturityDate.AddDate(0, 0, int(*validWeeks)*7)

controllers/grants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func ClaimGrant(w http.ResponseWriter, r *http.Request) {
8686

8787
conn := datastore.GetRedisConn(r.Context())
8888
// FIXME TODO clean this up via a better abstraction
89-
if _, err := redis.Int((*conn).Do("ZINCRBY", "count:claimed:ip", "1", r.RemoteAddr)); err != nil {
89+
if _, err = redis.Int((*conn).Do("ZINCRBY", "count:claimed:ip", "1", r.RemoteAddr)); err != nil {
9090
raven.CaptureMessage("Could not increment claim count for ip.", map[string]string{"IP": r.RemoteAddr})
9191
}
9292
if err = (*conn).Close(); err != nil {

wallet/provider/uphold/errors.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ type upholdDenominationValidationErrors struct {
1717
}
1818

1919
type upholdDenominationErrors struct {
20-
Code string `json:"code"`
21-
upholdDenominationValidationErrors `json:"errors,omitempty"`
22-
Data json.RawMessage `json:",omitempty"`
20+
Code string `json:"code"`
21+
ValidationErrors upholdDenominationValidationErrors `json:"errors,omitempty"`
22+
Data json.RawMessage `json:",omitempty"`
2323
}
2424

2525
type upholdValidationErrors struct {
@@ -44,12 +44,12 @@ func (uhErr upholdError) DenominationError() bool {
4444
}
4545

4646
func (uhErr upholdError) AmountError() bool {
47-
return uhErr.DenominationError() && len(uhErr.ValidationErrors.DenominationErrors.AmountError) > 0
47+
return uhErr.DenominationError() && len(uhErr.ValidationErrors.DenominationErrors.ValidationErrors.AmountError) > 0
4848
}
4949

5050
func (uhErr upholdError) InsufficientBalance() bool {
5151
if uhErr.AmountError() {
52-
for _, ae := range uhErr.ValidationErrors.DenominationErrors.AmountError {
52+
for _, ae := range uhErr.ValidationErrors.DenominationErrors.ValidationErrors.AmountError {
5353
if ae.Code == "sufficient_funds" {
5454
return true
5555
}
@@ -64,7 +64,7 @@ func (uhErr upholdError) InvalidSignature() bool {
6464

6565
func (uhErr upholdError) String() string {
6666
if uhErr.InsufficientBalance() {
67-
for _, ae := range uhErr.ValidationErrors.DenominationErrors.AmountError {
67+
for _, ae := range uhErr.ValidationErrors.DenominationErrors.ValidationErrors.AmountError {
6868
if ae.Code == "sufficient_funds" {
6969
return ae.Message
7070
}

0 commit comments

Comments
 (0)