diff --git a/README.md b/README.md index c431684..fcaaf55 100644 --- a/README.md +++ b/README.md @@ -36,10 +36,14 @@ Now we need to ask Secondly to take care of your configuration: ```go var conf Config secondly.Manage(&conf) + +// or asynchronously +go secondly.Manage(&conf) ``` -You'll probably want to know when configuration is loaded, so there's a handly -helper function just for that: +If you prefer to configure the app asynchronously then you'll probably want to +know when configuration is loaded, so there's a handly helper function just for +that: ```go secondly.OnLoad(func(){ @@ -53,7 +57,7 @@ configuration of your app. But this is not what you came for, right? If you want a configuration GUI, simply start Secondly's web server on a port you want. -``` +```go secondly.StartServer("", 5500) ``` diff --git a/secondly.go b/secondly.go index 5d6fcd7..e25ea72 100644 --- a/secondly.go +++ b/secondly.go @@ -171,6 +171,9 @@ func triggerCallbacks(oldConf, newConf interface{}) { // Don't trigger callbacks on fist load if !initialized { initialized = true + if initFunc != nil { + initFunc() + } return }