Skip to content

Commit

Permalink
Fixed linter issues, added nolint comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Feb 10, 2022
1 parent 5b74c75 commit 3f98196
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion actions/destinations/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (a *Action) list(w http.ResponseWriter, req *http.Request, _ httprouter.Par
var metadata *bux.Metadata
if len(metadataReq) > 0 {
// marshal the metadata into the Metadata model
metaJSON, _ := json.Marshal(metadataReq)
metaJSON, _ := json.Marshal(metadataReq) // nolint: errchkjson // ignore for now
_ = json.Unmarshal(metaJSON, &metadata)
}

Expand Down
10 changes: 5 additions & 5 deletions actions/paymail/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,22 @@ func (p *PaymailInterface) getPaymailInformation(ctx context.Context, alias,

paymailAddress, err := p.getPaymailAddress(ctx, alias, domain)
if err != nil {
return nil, "", nil, nil
return nil, "", nil, err
}

var xPub *bux.Xpub
if xPub, err = p.client.GetXpubByID(
ctx, paymailAddress.XPubID,
); err != nil {
return nil, "", nil, nil
return nil, "", nil, err
}

pubKey, address, lockingScript, keyErr := p.getPaymailKeys(
paymailAddress.ExternalXPubKey,
xPub.NextExternalNum,
)
if keyErr != nil {
return nil, "", nil, nil
return nil, "", nil, keyErr
}

// create a new destination, based on the External xPub child
Expand All @@ -210,13 +210,13 @@ func (p *PaymailInterface) getPaymailInformation(ctx context.Context, alias,
}

if err = destination.Save(ctx); err != nil {
return nil, "", nil, nil
return nil, "", nil, err
}

xPub.NextExternalNum++

if err = xPub.Save(ctx); err != nil {
return nil, "", nil, nil
return nil, "", nil, err
}

return paymailAddress, pubKey, destination, nil
Expand Down
3 changes: 2 additions & 1 deletion config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ func TestAppConfig_Validate(t *testing.T) {
})

t.Run("validate test config json", func(t *testing.T) {
app, _, txn := baseTestConfig(t)
app, services, txn := baseTestConfig(t)
require.NotNil(t, services)
err := app.Validate(txn)
assert.NoError(t, err)
})
Expand Down
2 changes: 1 addition & 1 deletion graph/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func GetConfigFromContextAdmin(ctx context.Context) (*GQLConfig, error) {
// ConditionsParseGraphQL parse the conditions passed from GraphQL
func ConditionsParseGraphQL(conditions map[string]interface{}) *map[string]interface{} {

c, _ := json.Marshal(conditions)
c, _ := json.Marshal(conditions) // nolint: errchkjson // ignore for now

// string replace all keys "__...." -> "$..."
m := regexp.MustCompile("\"__")
Expand Down

0 comments on commit 3f98196

Please sign in to comment.