Skip to content
This repository was archived by the owner on Nov 24, 2020. It is now read-only.

Commit 5e10078

Browse files
authored
go-lint fixes
2 parents f521ec4 + d63a547 commit 5e10078

File tree

6 files changed

+32
-37
lines changed

6 files changed

+32
-37
lines changed

ci/serverci.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ func main() {
445445
log.Println(err)
446446
continue
447447
}
448-
log.Println("build built succesfully")
448+
log.Println("build built successfully")
449449
writeLastBuilt()
450450
readLastBuilt()
451451
updateShaHashes()

database/database_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func TestDb(t *testing.T) {
198198
if err != nil {
199199
t.Fatal(err)
200200
}
201-
testuser, _ := SearchWithEmailId("blahx@blah.com")
201+
testuser, _ := SearchWithEmailID("blahx@blah.com")
202202
if testuser.Index != 0 {
203203
t.Fatalf("user with invalid email exists")
204204
}

database/user.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ type AnchorKYCHelper struct {
128128
}
129129
Tax struct {
130130
Country string
131-
Id string
131+
ID string
132132
}
133133
Address struct {
134134
Street string
@@ -142,8 +142,8 @@ type AnchorKYCHelper struct {
142142
Gender string
143143
DepositIdentifier string
144144
WithdrawIdentifier string
145-
Url string
146-
AccountId string
145+
URL string
146+
AccountID string
147147
}
148148

149149
// StellWallet hold the Stellar Publickey and Encrypted Seed
@@ -417,8 +417,8 @@ func (a *User) IncreaseTrustLimit(seedpwd string, trust float64) error {
417417
return nil
418418
}
419419

420-
// SearchWithEmailId searches for a user given their email id
421-
func SearchWithEmailId(email string) (User, error) {
420+
// SearchWithEmailID searches for a user given their email id
421+
func SearchWithEmailID(email string) (User, error) {
422422
var dummy User
423423
users, err := RetrieveAllUsers()
424424
if err != nil {

rpc/anchor.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ func setupAnchorHandlers() {
5050
// AnchorIntentResponse defines the intent response struct for AnchorUSD
5151
type AnchorIntentResponse struct {
5252
Type string `json:"type"`
53-
Url string `json:"url"`
53+
URL string `json:"url"`
5454
Identifier string `json:"identifier"`
5555
}
5656

5757
// kycDepositResponse defines the kyc response st ruct for AnchorUSD
5858
type kycDepositResponse struct {
5959
Error string
6060
Result string
61-
Url string
61+
URL string
6262
}
6363

6464
// GetAndReturnIdentifier is a handler that makes a get request and returns json data
@@ -109,7 +109,7 @@ func intentDeposit() {
109109
}
110110

111111
prepUser.AnchorKYC.DepositIdentifier = x.Identifier
112-
prepUser.AnchorKYC.Url = x.Url
112+
prepUser.AnchorKYC.URL = x.URL
113113
err = prepUser.Save()
114114
if erpc.Err(w, err, erpc.StatusInternalServerError) {
115115
return
@@ -135,7 +135,7 @@ func kycDeposit() {
135135
data.Set("birthday[day]", prepUser.AnchorKYC.Birthday.Day)
136136
data.Set("birthday[year]", prepUser.AnchorKYC.Birthday.Year)
137137
data.Set("tax-country", prepUser.AnchorKYC.Tax.Country)
138-
data.Set("tax-id-number", prepUser.AnchorKYC.Tax.Id)
138+
data.Set("tax-id-number", prepUser.AnchorKYC.Tax.ID)
139139
data.Set("address[street-1]", prepUser.AnchorKYC.Address.Street)
140140
data.Set("address[city]", prepUser.AnchorKYC.Address.City)
141141
data.Set("address[postal-code]", prepUser.AnchorKYC.Address.Postal)
@@ -169,7 +169,7 @@ func intentWithdraw() {
169169
}
170170

171171
prepUser.AnchorKYC.WithdrawIdentifier = x.Identifier
172-
prepUser.AnchorKYC.Url = x.Url
172+
prepUser.AnchorKYC.URL = x.URL
173173
err = prepUser.Save()
174174
if erpc.Err(w, err, erpc.StatusInternalServerError) {
175175
return
@@ -197,7 +197,7 @@ func kycWithdraw() {
197197
data.Set("birthday[day]", prepUser.AnchorKYC.Birthday.Day)
198198
data.Set("birthday[year]", prepUser.AnchorKYC.Birthday.Year)
199199
data.Set("tax-country", prepUser.AnchorKYC.Tax.Country)
200-
data.Set("tax-id-number", prepUser.AnchorKYC.Tax.Id)
200+
data.Set("tax-id-number", prepUser.AnchorKYC.Tax.ID)
201201
data.Set("address[street-1]", prepUser.AnchorKYC.Address.Street)
202202
data.Set("address[city]", prepUser.AnchorKYC.Address.City)
203203
data.Set("address[postal-code]", prepUser.AnchorKYC.Address.Postal)
@@ -216,7 +216,7 @@ func kycWithdraw() {
216216
}
217217

218218
type kycReturn struct {
219-
AccountId string `json:"account_id"`
219+
AccountID string `json:"account_id"`
220220
KycStatus string `json:"kyc_status`
221221
}
222222

@@ -228,7 +228,7 @@ func getKycStatus() {
228228
return
229229
}
230230

231-
body := consts.AnchorAPI + "api/accounts/" + prepUser.AnchorKYC.AccountId + "/kyc"
231+
body := consts.AnchorAPI + "api/accounts/" + prepUser.AnchorKYC.AccountID + "/kyc"
232232

233233
data, err := erpc.GetRequest(body)
234234
if erpc.Err(w, err, erpc.StatusInternalServerError) {
@@ -253,7 +253,7 @@ func getKycStatus() {
253253

254254
type kycR struct {
255255
URL string `json:"url"`
256-
AccountId string `json:"account_id"`
256+
AccountID string `json:"account_id"`
257257
}
258258

259259
// kycRegister is used to register for KYC on AnchorUSD's platform
@@ -272,7 +272,7 @@ func kycRegister() {
272272
data.Set("birthday[day]", prepUser.AnchorKYC.Birthday.Day)
273273
data.Set("birthday[year]", prepUser.AnchorKYC.Birthday.Year)
274274
data.Set("tax-country", prepUser.AnchorKYC.Tax.Country)
275-
data.Set("tax-id-number", prepUser.AnchorKYC.Tax.Id)
275+
data.Set("tax-id-number", prepUser.AnchorKYC.Tax.ID)
276276
data.Set("address[street-1]", prepUser.AnchorKYC.Address.Street)
277277
data.Set("address[city]", prepUser.AnchorKYC.Address.City)
278278
data.Set("address[postal-code]", prepUser.AnchorKYC.Address.Postal)
@@ -293,7 +293,7 @@ func kycRegister() {
293293
return
294294
}
295295

296-
prepUser.AnchorKYC.AccountId = ret.AccountId
296+
prepUser.AnchorKYC.AccountID = ret.AccountID
297297
err = prepUser.Save()
298298
if erpc.Err(w, err, erpc.StatusInternalServerError) {
299299
return

rpc/complyadvantage.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type CAResponse struct {
3030
Status string `json:"string"`
3131
Content struct {
3232
Data struct {
33-
Id int64 `json:"id"`
33+
ID int64 `json:"id"`
3434
Ref string `json:"ref"`
3535
Searcherid int64 `json:"searcher_id"`
3636
Assigneeid int64 `json:"assignee_id"`
@@ -72,12 +72,12 @@ type CAResponse struct {
7272
Tag string `json:"tag"`
7373
Value string `json:"value"`
7474
} `json:"fields"`
75-
Id string
75+
ID string
7676
Media []struct {
7777
Date string `json:"date"`
7878
Snippet string `json:"snippet"`
7979
Title string `json:"title"`
80-
Url string `json:"url"`
80+
URL string `json:"url"`
8181
} `json:"media"`
8282
Name string `json:"name"`
8383
Sources []string `json:"sources"`
@@ -172,7 +172,7 @@ type caAllUserResponse struct {
172172
Status string `json:"status"`
173173
Content struct {
174174
Data []struct {
175-
Id int `json:"id"`
175+
ID int `json:"id"`
176176
Email string `json:"email"`
177177
Name string `json:"name"`
178178
Phone string `json:"phone"`

rpc/users.go

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,6 @@ func setupUserRpcs() {
113113
// addContractHash()
114114
}
115115

116-
const (
117-
// TellerUrl defines the teller URL to check. In future, would be an array
118-
TellerUrl = "https://localhost"
119-
)
120-
121116
func checkReqdParams(w http.ResponseWriter, r *http.Request, options []string, method string) error {
122117
if method == "GET" {
123118
err := erpc.CheckGet(w, r)
@@ -712,7 +707,7 @@ func generateResetPwdCode() {
712707

713708
email := r.URL.Query()["email"][0]
714709

715-
rUser, err := database.SearchWithEmailId(email)
710+
rUser, err := database.SearchWithEmailID(email)
716711
if erpc.Err(w, err, erpc.StatusInternalServerError) {
717712
return
718713
}
@@ -753,7 +748,7 @@ func resetPassword() {
753748
vCode := r.URL.Query()["verificationCode"][0]
754749
pwhash := r.URL.Query()["pwhash"][0]
755750

756-
rUser, err := database.SearchWithEmailId(email)
751+
rUser, err := database.SearchWithEmailID(email)
757752
if erpc.Err(w, err, erpc.StatusInternalServerError) {
758753
return
759754
}
@@ -894,43 +889,43 @@ func validateKYC() {
894889
return
895890
}
896891

897-
var isId bool
892+
var isID bool
898893
var idType string
899894
var id string
900895
var verif bool
901896

902897
prepUser.KYC.PersonalPhoto = r.URL.Query()["selfie"][0]
903898

904899
if r.URL.Query()["passport"] != nil {
905-
isId = true
900+
isID = true
906901
idType = "passport"
907902
id = r.URL.Query()["passport"][0]
908903
prepUser.KYC.PassportPhoto = id
909904
}
910905

911906
if r.URL.Query()["dlicense"] != nil {
912-
isId = true
907+
isID = true
913908
idType = "dlicense"
914909
id = r.URL.Query()["dlicense"][0]
915910
prepUser.KYC.DriversLicense = id
916911
}
917912

918913
if r.URL.Query()["idcard"] != nil {
919-
isId = true
914+
isID = true
920915
idType = "idcard"
921916
id = r.URL.Query()["idcard"][0]
922917
prepUser.KYC.IDCardPhoto = id
923918
}
924919

925-
if !isId {
920+
if !isID {
926921
erpc.ResponseHandler(w, erpc.StatusBadRequest)
927922
return
928923
}
929924

930925
var response KycResponse
931926
var apikey = consts.KYCAPIKey
932-
apiUrl := "https://api.complyadvantage.com"
933-
body := apiUrl + "/" + apikey
927+
apiURL := "https://api.complyadvantage.com"
928+
body := apiURL + "/" + apikey
934929

935930
switch idType {
936931
case "passport":
@@ -1075,7 +1070,7 @@ func addAnchorKYCInfo() {
10751070
prepUser.AnchorKYC.Birthday.Day = r.URL.Query()["bdayday"][0]
10761071
prepUser.AnchorKYC.Birthday.Year = r.URL.Query()["bdayyear"][0]
10771072
prepUser.AnchorKYC.Tax.Country = r.URL.Query()["taxcountry"][0]
1078-
prepUser.AnchorKYC.Tax.Id = r.URL.Query()["taxid"][0]
1073+
prepUser.AnchorKYC.Tax.ID = r.URL.Query()["taxid"][0]
10791074
prepUser.AnchorKYC.Address.Street = r.URL.Query()["addrstreet"][0]
10801075
prepUser.AnchorKYC.Address.City = r.URL.Query()["addrcity"][0]
10811076
prepUser.AnchorKYC.Address.Postal = r.URL.Query()["addrpostal"][0]

0 commit comments

Comments
 (0)