mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 17:58:45 +02:00
refactor(icons): hasIcon always return true in tests
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
package icons
|
package icons
|
||||||
|
|
||||||
import "sync/atomic"
|
import (
|
||||||
|
"sync/atomic"
|
||||||
|
|
||||||
|
"github.com/yusing/godoxy/internal/common"
|
||||||
|
)
|
||||||
|
|
||||||
type Provider interface {
|
type Provider interface {
|
||||||
HasIcon(u *URL) bool
|
HasIcon(u *URL) bool
|
||||||
@@ -13,6 +17,9 @@ func SetProvider(p Provider) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func hasIcon(u *URL) bool {
|
func hasIcon(u *URL) bool {
|
||||||
|
if common.IsTest {
|
||||||
|
return true
|
||||||
|
}
|
||||||
v := provider.Load()
|
v := provider.Load()
|
||||||
if v == nil {
|
if v == nil {
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user