MCPcopy Create free account
hub / github.com/diillson/chatcli / InitGlobal

Function InitGlobal

config/manager.go:34–39  ·  view source on GitHub ↗

InitGlobal initializes the global ConfigManager singleton (thread-safe). Subsequent calls are no-ops — use Global.Reload() to refresh configuration.

(logger *zap.Logger)

Source from the content-addressed store, hash-verified

32// InitGlobal initializes the global ConfigManager singleton (thread-safe).
33// Subsequent calls are no-ops — use Global.Reload() to refresh configuration.
34func InitGlobal(logger *zap.Logger) *ConfigManager {
35 globalOnce.Do(func() {
36 Global = New(logger)
37 })
38 return Global
39}
40
41// ResetGlobalForTest resets the singleton for test isolation.
42// Must NOT be used in production code.

Callers 4

mainFunction · 0.92
runSubcommandFunction · 0.92
runDaemonSubcommandFunction · 0.92
ResetGlobalForTestFunction · 0.85

Calls 2

DoMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected