mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-25 01:38:30 +02:00
refactor(config): reduce references to config.GetInstance()
This commit is contained in:
16
internal/homepage/types/config.go
Normal file
16
internal/homepage/types/config.go
Normal 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,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user