refactor(icons): hasIcon always return true in tests

This commit is contained in:
yusing
2026-02-15 20:05:34 +08:00
parent 54ea4d8790
commit f8bc8dddb6

View File

@@ -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