* Move examples from cmd to examples dir * Update Makefile * LoadJsonFile() dies in-place on read or parse error which is not correct * LoadJsonFile() wastes Instance map, now it returns its own map and error if any
32 lines
514 B
Go
32 lines
514 B
Go
package main
|
|
|
|
import (
|
|
"doll/internal/doll"
|
|
"doll/internal/log"
|
|
"os"
|
|
|
|
"github.com/davecgh/go-spew/spew"
|
|
)
|
|
|
|
func main() {
|
|
// Init log subsystem.
|
|
log.Init("info", os.Stderr)
|
|
|
|
file := "example_data/01-config.json"
|
|
|
|
// Load the Lua script file.
|
|
log.Infof("Loading %s", file)
|
|
|
|
data, err := doll.LoadJsonFile(file)
|
|
|
|
if err != nil {
|
|
log.Fatalf("Unable to unmarshal %s to map: %s", file, err)
|
|
}
|
|
|
|
log.Infof("Map unmarshalled from %s", file)
|
|
|
|
spew.Dump(data)
|
|
}
|
|
|
|
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */
|