generated from templates/go-generic
Dan Anglin
7783c10504
- Moved the state implementation to internal/state. - Moved the executors to internal/executors.
19 lines
245 B
Go
19 lines
245 B
Go
package executors
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/lib/pq"
|
|
)
|
|
|
|
func uniqueViolation(err error) bool {
|
|
var pqError *pq.Error
|
|
|
|
if errors.As(err, &pqError) {
|
|
if pqError.Code.Name() == "unique_violation" {
|
|
return true
|
|
}
|
|
}
|
|
|
|
return false
|
|
}
|