func buildHangUp(ctx *builder.Context) { signalChan := make(chan os.Signal) signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM) builder.Build(ctx) <-signalChan log15.Info("Close") }
func build(ctx *builder.Context, mustWatch bool) { // ctrl+C capture signalChan := make(chan os.Signal) signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM) builder.Build(ctx) if ctx.Cli().Bool("watch") || mustWatch { builder.Watch(ctx) <-signalChan log15.Info("Watch|Close") } }