Reflect magic

This commit is contained in:
2015-08-29 21:51:12 +03:00
parent d1131d158f
commit be052e2c75
2 changed files with 27 additions and 7 deletions
+4 -1
View File
@@ -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