From 7b48757b27da8fc7336b86e746f3fa071beeb665 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 13 Oct 2023 10:44:59 +0800 Subject: [PATCH] clash: remove workaround for go 1.20 Signed-off-by: Tianling Shen --- net/clash/Makefile | 2 +- net/clash/patches/010-go-120.patch | 40 ------------------------------ 2 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 net/clash/patches/010-go-120.patch diff --git a/net/clash/Makefile b/net/clash/Makefile index c246cdb7af..29bc75f1a9 100644 --- a/net/clash/Makefile +++ b/net/clash/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=clash PKG_VERSION:=1.18.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/Dreamacro/clash/tar.gz/v$(PKG_VERSION)? diff --git a/net/clash/patches/010-go-120.patch b/net/clash/patches/010-go-120.patch deleted file mode 100644 index f81764bbac..0000000000 --- a/net/clash/patches/010-go-120.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- a/component/profile/cachefile/cache.go -+++ b/component/profile/cachefile/cache.go -@@ -13,7 +13,9 @@ import ( - ) - - var ( -- fileMode os.FileMode = 0o666 -+ initOnce sync.Once -+ fileMode os.FileMode = 0o666 -+ defaultCache *CacheFile - - bucketSelected = []byte("selected") - bucketFakeip = []byte("fakeip") -@@ -134,8 +136,7 @@ func (c *CacheFile) Close() error { - return c.DB.Close() - } - --// Cache return singleton of CacheFile --var Cache = sync.OnceValue(func() *CacheFile { -+func initCache() { - options := bbolt.Options{Timeout: time.Second} - db, err := bbolt.Open(C.Path.Cache(), fileMode, &options) - switch err { -@@ -151,7 +152,14 @@ var Cache = sync.OnceValue(func() *Cache - log.Warnln("[CacheFile] can't open cache file: %s", err.Error()) - } - -- return &CacheFile{ -+ defaultCache = &CacheFile{ - DB: db, - } --}) -+} -+ -+// Cache return singleton of CacheFile -+func Cache() *CacheFile { -+ initOnce.Do(initCache) -+ -+ return defaultCache -+}