Skip to content

Commit

Permalink
Merge pull request #16 from wind0r/ignore_lint_err_on_defer_rollback
Browse files Browse the repository at this point in the history
ignore errcheck lint warnings for defer rollback
  • Loading branch information
tobikris authored Oct 19, 2022
2 parents 7c40364 + c7a367d commit f0e53f6
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 f0e53f6

Please sign in to comment.