Make only referenc of ErrUnknownVersion an error (#648)
just a refactor nit Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/648 Reviewed-by: John Olheiser <jolheiser@noreply.gitea.com>
This commit is contained in:
parent
f4c493667c
commit
8942536a0b
1 changed files with 4 additions and 5 deletions
|
@ -81,14 +81,13 @@ type ErrUnknownVersion struct {
|
|||
}
|
||||
|
||||
// Error fulfills error
|
||||
func (e ErrUnknownVersion) Error() string {
|
||||
func (e *ErrUnknownVersion) Error() string {
|
||||
return fmt.Sprintf("unknown version: %s", e.raw)
|
||||
}
|
||||
|
||||
func (ErrUnknownVersion) Is(target error) bool {
|
||||
_, ok1 := target.(*ErrUnknownVersion)
|
||||
_, ok2 := target.(ErrUnknownVersion)
|
||||
return ok1 || ok2
|
||||
func (*ErrUnknownVersion) Is(target error) bool {
|
||||
_, ok := target.(*ErrUnknownVersion)
|
||||
return ok
|
||||
}
|
||||
|
||||
// checkServerVersionGreaterThanOrEqual is the canonical way in the SDK to check for versions for API compatibility reasons
|
||||
|
|
Loading…
Reference in a new issue