func main() { addr := flag.String("addr", "localhost:3007", "address of http server") debug := flag.Bool("debug", false, "start in debug mode") configFile := flag.String("config", "~/.blank/config.yaml", "path to config file") flag.Parse() // setup logging if *debug { log.SetLevel(log.DebugLevel) } w := log.StandardLogger().Writer() defer w.Close() common.Log = _log.New(w, "", 0) // start editor editor, err := blank.NewBlank(*addr, *debug, *configFile) if err != nil { log.Fatalf("failed to initialize blank: %v", err) } if err := editor.Start(); err != nil { log.Fatalf("failed to start blank: %v", err) } }
func TestNewBlank(t *testing.T) { b, err := blank.NewBlank("", false, "") ensure.NotNil(t, b) ensure.Nil(t, err) }