1
1
package osin
2
2
3
3
import (
4
- "errors"
5
4
"strconv"
6
5
"time"
7
6
)
@@ -74,7 +73,7 @@ func (s *TestingStorage) GetClient(id string) (Client, error) {
74
73
if c , ok := s .clients [id ]; ok {
75
74
return c , nil
76
75
}
77
- return nil , errors . New ( "Client not found" )
76
+ return nil , ErrNotFound
78
77
}
79
78
80
79
func (s * TestingStorage ) SetClient (id string , client Client ) error {
@@ -91,7 +90,7 @@ func (s *TestingStorage) LoadAuthorize(code string) (*AuthorizeData, error) {
91
90
if d , ok := s .authorize [code ]; ok {
92
91
return d , nil
93
92
}
94
- return nil , errors . New ( "Authorize not found" )
93
+ return nil , ErrNotFound
95
94
}
96
95
97
96
func (s * TestingStorage ) RemoveAuthorize (code string ) error {
@@ -111,7 +110,7 @@ func (s *TestingStorage) LoadAccess(code string) (*AccessData, error) {
111
110
if d , ok := s .access [code ]; ok {
112
111
return d , nil
113
112
}
114
- return nil , errors . New ( "Access not found" )
113
+ return nil , ErrNotFound
115
114
}
116
115
117
116
func (s * TestingStorage ) RemoveAccess (code string ) error {
@@ -123,7 +122,7 @@ func (s *TestingStorage) LoadRefresh(code string) (*AccessData, error) {
123
122
if d , ok := s .refresh [code ]; ok {
124
123
return s .LoadAccess (d )
125
124
}
126
- return nil , errors . New ( "Refresh not found" )
125
+ return nil , ErrNotFound
127
126
}
128
127
129
128
func (s * TestingStorage ) RemoveRefresh (code string ) error {
0 commit comments