refactor(config): reduce references to config.GetInstance()

This commit is contained in:
yusing
2025-10-07 21:49:00 +08:00
parent 584db2efce
commit a150f1a628
8 changed files with 36 additions and 11 deletions

View File

@@ -0,0 +1,16 @@
package homepage
import "sync/atomic"
type Config struct {
UseDefaultCategories bool `json:"use_default_categories"`
}
// nil-safe
var ActiveConfig atomic.Pointer[Config]
func init() {
ActiveConfig.Store(&Config{
UseDefaultCategories: true,
})
}