From c7279f80d0f994abce01d701e0f3244b0123ad80 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Sat, 29 Aug 2015 20:44:48 +0300 Subject: [PATCH] Readme fix #2 --- README.md | 10 +++++++--- secondly.go | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) 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 }