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