Move RnD sample programs to examples dir, rename test_data to example_data, add stubs for server and client
This commit is contained in:
24
examples/01-LoadJsonFile/main.go
Normal file
24
examples/01-LoadJsonFile/main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"doll/internal/doll"
|
||||
"doll/internal/log"
|
||||
"os"
|
||||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
)
|
||||
|
||||
func main() {
|
||||
file := "example_data/01-config.json"
|
||||
|
||||
log.Init("info", os.Stderr)
|
||||
log.Infof("loading %s", file)
|
||||
|
||||
data := doll.LoadJsonFile(file)
|
||||
|
||||
log.Infof("data from %s", file)
|
||||
|
||||
spew.Dump(data)
|
||||
}
|
||||
|
||||
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */
|
||||
Reference in New Issue
Block a user