Skip to content

Commit

Permalink
Fix staticcheck warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas11 committed May 31, 2024
1 parent 17b3239 commit cb4bff9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions infer/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ func (o Options) dispatch() dispatch.Options {
functions := map[tokens.Type]t.Invoke{}
for _, r := range o.Functions {
typ, err := r.GetToken()
contract.AssertNoError(err)
contract.AssertNoErrorf(err, "failed to get token for function %v", r)
functions[typ] = r
}
customs := map[tokens.Type]t.CustomResource{}
for _, r := range o.Resources {
typ, err := r.GetToken()
contract.AssertNoError(err)
contract.AssertNoErrorf(err, "failed to get token for resource %v", r)
customs[typ] = r
}
components := map[tokens.Type]t.ComponentResource{}
for _, r := range o.Components {
typ, err := r.GetToken()
contract.AssertNoError(err)
contract.AssertNoErrorf(err, "failed to get token for component %v", r)
components[typ] = r
}
return dispatch.Options{
Expand Down
4 changes: 2 additions & 2 deletions infer/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,11 +646,11 @@ func (g *fieldGenerator) ensureDefaultSecrets() {

args, ok, err := g.argsMatcher.TargetStructFields(g.args)
contract.Assertf(ok, "we match by construction")
contract.AssertNoError(err)
contract.AssertNoErrorf(err, "TargetStructFields on %v", g.args)

state, ok, err := g.stateMatcher.TargetStructFields(g.state)
contract.Assertf(ok, "we match by construction")
contract.AssertNoError(err)
contract.AssertNoErrorf(err, "TargetStructFields on %v", g.state)

for _, f := range state {
if f.Internal {
Expand Down

0 comments on commit cb4bff9

Please sign in to comment.