Skip to content

Commit

Permalink
fix: lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jeronimoalbi committed Oct 17, 2023
1 parent e0a2f46 commit 4e5bac2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ignite/pkg/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (c Cache[T]) Put(key string, value T) error {
func (c Cache[T]) Get(key string) (val T, err error) {
db, err := openDB(c.storage.storagePath)
if err != nil {
return
return val, err
}
defer db.Close()

Expand Down
10 changes: 5 additions & 5 deletions ignite/pkg/cosmosanalysis/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,25 +220,25 @@ func newUnexpectedTypeErr(n any) error {
func findBasicManagerRegistrations(n ast.Node, pkgDir string, fileImports map[string]string) (packages []string, err error) {
callExprType, ok := n.(*ast.CallExpr)
if !ok {
return
return packages, err
}

selectorExprType, ok := callExprType.Fun.(*ast.SelectorExpr)
if !ok {
return
return packages, err
}

identExprType, ok := selectorExprType.X.(*ast.Ident)
if !ok {
return
return packages, err
}
basicModulePkgName := findBasicManagerPkgName(fileImports)
if basicModulePkgName == "" {
// cosmos-sdk/types/module is not imported in this file, skip
return
return packages, err
}
if identExprType.Name != basicModulePkgName || selectorExprType.Sel.Name != "NewBasicManager" {
return
return packages, err
}

// Node "n" defines the call to NewBasicManager, let's loop on its args to discover modules
Expand Down
5 changes: 3 additions & 2 deletions ignite/pkg/placeholder/error.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package placeholder

import (
"errors"
"fmt"
"strings"

Expand All @@ -18,8 +19,8 @@ type MissingPlaceholdersError struct {

// Is true if both errors have the same list of missing placeholders.
func (e *MissingPlaceholdersError) Is(err error) bool {
other, ok := err.(*MissingPlaceholdersError) //nolint:errorlint
if !ok {
var other *MissingPlaceholdersError
if !errors.As(err, &other) {
return false
}
if len(other.missing) != len(e.missing) {
Expand Down

0 comments on commit 4e5bac2

Please sign in to comment.