token.go 328 B

12345678910111213141516
  1. package errors
  2. import "fmt"
  3. type AccessTokenNameAlreadyExist struct {
  4. Name string
  5. }
  6. func IsAccessTokenNameAlreadyExist(err error) bool {
  7. _, ok := err.(AccessTokenNameAlreadyExist)
  8. return ok
  9. }
  10. func (err AccessTokenNameAlreadyExist) Error() string {
  11. return fmt.Sprintf("access token already exist [name: %s]", err.Name)
  12. }