Skip to content

Commit 93a9a8b

Browse files
fridolin-kochshuLhan
authored andcommitted
Use os.ErrNotExists
1 parent 4671a58 commit 93a9a8b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

toc.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ func AssetDir(name string) ([]string, error) {
114114
for _, p := range pathList {
115115
node = node.Children[p]
116116
if node == nil {
117-
return nil, fmt.Errorf("Asset %%s not found", name)
117+
return nil, os.ErrNotExist
118118
}
119119
}
120120
}
121121
if node.Func != nil {
122-
return nil, fmt.Errorf("Asset %%s not found", name)
122+
return nil, os.ErrNotExist
123123
}
124124
rv := make([]string, 0, len(node.Children))
125125
for childName := range node.Children {
@@ -171,7 +171,7 @@ func Asset(name string) ([]byte, error) {
171171
}
172172
return a.bytes, nil
173173
}
174-
return nil, fmt.Errorf("Asset %%s not found", name)
174+
return nil, os.ErrNotExist
175175
}
176176
177177
// MustAsset is like Asset but panics when Asset would return an error.
@@ -197,7 +197,7 @@ func AssetInfo(name string) (os.FileInfo, error) {
197197
}
198198
return a.info, nil
199199
}
200-
return nil, fmt.Errorf("AssetInfo %%s not found", name)
200+
return nil, os.ErrNotExist
201201
}
202202
203203
// AssetNames returns the names of the assets.

0 commit comments

Comments
 (0)