Skip to content

Commit

Permalink
ignore errcheck lint warnings for defer rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
wind0r committed Oct 19, 2022
1 parent 7c40364 commit c7a367d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/lock/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewLock(table string) (*Lock, error) {
return nil, fmt.Errorf("checking locks table: %w", err)
}

defer tx.Rollback()
defer tx.Rollback() // nolint: errcheck

if _, err := tx.Exec(`CREATE TABLE IF NOT EXISTS ` + l.table + ` (
state_id CHARACTER VARYING(255) PRIMARY KEY,
Expand Down Expand Up @@ -66,7 +66,7 @@ func (l *Lock) Lock(s *terraform.State) (bool, error) {
return false, err
}

defer tx.Rollback()
defer tx.Rollback() // nolint: errcheck

var rawLock []byte

Expand Down Expand Up @@ -116,7 +116,7 @@ func (l *Lock) Unlock(s *terraform.State) (bool, error) {
return false, err
}

defer tx.Rollback()
defer tx.Rollback() // nolint: errcheck

var rawLock []byte

Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func NewPostgresStorage(table string) (*PostgresStorage, error) {
return nil, fmt.Errorf("checking states table: %w", err)
}

defer tx.Rollback()
defer tx.Rollback() // nolint: errcheck

if _, err := tx.Exec(`CREATE TABLE IF NOT EXISTS ` + p.table + ` (
state_id CHARACTER VARYING(255) PRIMARY KEY,
Expand Down

0 comments on commit c7a367d

Please sign in to comment.