Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronc committed Jul 8, 2024
1 parent 04fd8b4 commit 8c79a6c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions indexer/postgres/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func writeNullability(writer io.Writer, nullable bool) error {

// simpleColumnType returns the postgres column type for the kind for simple types.
func simpleColumnType(kind schema.Kind) string {
//nolint:goconst
switch kind {
case schema.StringKind:
return "TEXT"
Expand Down
3 changes: 2 additions & 1 deletion indexer/postgres/enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ func (m *ModuleManager) CreateEnumType(ctx context.Context, conn DBConn, enum sc
var res interface{}
if err := row.Scan(&res); err != nil {
if err != sql.ErrNoRows {
return fmt.Errorf("failed to check if enum type %q exists: %v", typeName, err)
// use %v instead of %w for go 1.12 compat
return fmt.Errorf("failed to check if enum type %q exists: %v", typeName, err) //nolint:errorlint
}
} else {
// the enum type already exists
Expand Down
3 changes: 2 additions & 1 deletion indexer/postgres/module_mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ func (m *ModuleManager) InitializeSchema(ctx context.Context, conn DBConn) error
m.tables[typ.Name] = tm
err := tm.CreateTable(ctx, conn)
if err != nil {
return fmt.Errorf("failed to create table for %s in module %s: %v", typ.Name, m.moduleName, err)
// use %v instead of %w for go 1.12 compat
return fmt.Errorf("failed to create table for %s in module %s: %v", typ.Name, m.moduleName, err) //nolint:errorlint
}
}

Expand Down

0 comments on commit 8c79a6c

Please sign in to comment.