Created
November 24, 2023 11:50
-
-
Save yumed15/da562cd81455ab6dd2af08470d876d13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var once sync.Once | |
var globalSetting string | |
func initializeGlobals() { | |
globalSetting = readSettingFromConfig() | |
} | |
func getGlobalSetting() string { | |
once.Do(initializeGlobals) | |
return globalSetting | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment