diff --git a/indexer/postgres/column.go b/indexer/postgres/column.go index aa980d385561..a2e65ea0b6db 100644 --- a/indexer/postgres/column.go +++ b/indexer/postgres/column.go @@ -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" diff --git a/indexer/postgres/enum.go b/indexer/postgres/enum.go index 2f77e0d4a757..7799e23d85f3 100644 --- a/indexer/postgres/enum.go +++ b/indexer/postgres/enum.go @@ -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 diff --git a/indexer/postgres/module_mgr.go b/indexer/postgres/module_mgr.go index dc9edda5cf67..f7ab937a1798 100644 --- a/indexer/postgres/module_mgr.go +++ b/indexer/postgres/module_mgr.go @@ -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 } }