code: func IsUniqueViolation(err error, indexName string) bool {
  	if err == nil {
  		return false
  	}
  	pqError, ok := err.(*pq.Error)
  	if !ok {
  		return false
  	}
  	return pqError.Code == errUniqueViolation && pqError.Constraint == indexName
  }
docs: // IsUniqueViolation returns true if the error is a violation of the given unique index