chore: update to go 1.18 (#628)

* add make lint to Makefile
This commit is contained in:
Colin Adler
2022-03-28 14:14:40 -05:00
committed by GitHub
parent b33dec9d38
commit be8389fd74
13 changed files with 35 additions and 561 deletions

View File

@ -138,5 +138,7 @@ func getFreePort() (port int, err error) {
}
defer listener.Close()
// This is always a *net.TCPAddr.
// nolint:forcetypeassert
return listener.Addr().(*net.TCPAddr).Port, nil
}

View File

@ -72,6 +72,9 @@ func (p *pgPubsub) Subscribe(event string, listener Listener) (cancel func(), er
}
func (p *pgPubsub) Publish(event string, message []byte) error {
// This is safe because we are calling pq.QuoteLiteral. pg_notify doesn't
// support the first parameter being a prepared statement.
//nolint:gosec
_, err := p.db.ExecContext(context.Background(), `select pg_notify(`+pq.QuoteLiteral(event)+`, $1)`, message)
if err != nil {
return xerrors.Errorf("exec: %w", err)