mirror of
https://github.com/Pungyeon/clean-go-article.git
synced 2024-11-23 06:04:05 +00:00
changed bool checks to make sense
This commit is contained in:
parent
1aead7e4d1
commit
5272e93547
|
@ -272,15 +272,18 @@ func GetItem(extension string) (Item, error) {
|
|||
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
|
||||
}
|
||||
|
||||
if itemIface, ok := db.ItemCache.Get(ref); ok {
|
||||
itemIface, ok := db.ItemCache.Get(ref)
|
||||
if !ok {
|
||||
// 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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue