mirror of
https://github.com/Pungyeon/clean-go-article.git
synced 2024-11-23 06:04:05 +00:00
Merge pull request #31 from Pungyeon/inverted_bool_checks
changed bool checks to make sense
This commit is contained in:
commit
061ee338a3
|
@ -272,15 +272,18 @@ func GetItem(extension string) (Item, error) {
|
||||||
return EmptyItem, errors.New("reference not found in cache")
|
return EmptyItem, errors.New("reference not found in cache")
|
||||||
}
|
}
|
||||||
|
|
||||||
if ref, ok := refIface.(string); ok {
|
ref, ok := refIface.(string)
|
||||||
|
if !ok {
|
||||||
// return cast error on reference
|
// return cast error on reference
|
||||||
}
|
}
|
||||||
|
|
||||||
if itemIface, ok := db.ItemCache.Get(ref); ok {
|
itemIface, ok := db.ItemCache.Get(ref)
|
||||||
|
if !ok {
|
||||||
// return no item found in cache by reference
|
// return no item found in cache by reference
|
||||||
}
|
}
|
||||||
|
|
||||||
if item, ok := itemIface.(Item); ok {
|
item, ok := itemIface.(Item)
|
||||||
|
if !ok {
|
||||||
// return cast error on item interface
|
// return cast error on item interface
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue