mirror of
https://github.com/gogs/gogs.git
synced 2025-12-21 15:50:00 +01:00
17 lines
328 B
Go
17 lines
328 B
Go
|
|
package errors
|
||
|
|
|
||
|
|
import "fmt"
|
||
|
|
|
||
|
|
type AccessTokenNameAlreadyExist struct {
|
||
|
|
Name string
|
||
|
|
}
|
||
|
|
|
||
|
|
func IsAccessTokenNameAlreadyExist(err error) bool {
|
||
|
|
_, ok := err.(AccessTokenNameAlreadyExist)
|
||
|
|
return ok
|
||
|
|
}
|
||
|
|
|
||
|
|
func (err AccessTokenNameAlreadyExist) Error() string {
|
||
|
|
return fmt.Sprintf("access token already exist [name: %s]", err.Name)
|
||
|
|
}
|