Reflect magic
This commit is contained in:
+4
-1
@@ -4,6 +4,8 @@ import (
|
||||
"flag"
|
||||
"log"
|
||||
|
||||
"github.com/kr/pretty"
|
||||
|
||||
"github.com/localhots/secondly"
|
||||
)
|
||||
|
||||
@@ -40,8 +42,9 @@ func main() {
|
||||
// Starting a web server
|
||||
secondly.StartServer("", 5500)
|
||||
// Defining callbacks
|
||||
secondly.OnChange("AppName", func(o, n interface{}) {
|
||||
secondly.OnChange("app_name", func(o, n interface{}) {
|
||||
log.Printf("OMG! AppName changed from %q to %q", o, n)
|
||||
pretty.Println(conf)
|
||||
})
|
||||
|
||||
// Other application startup logic
|
||||
|
||||
Reference in New Issue
Block a user