diff --git a/_example/web.go b/_example/web.go index c5912f2..e24714b 100644 --- a/_example/web.go +++ b/_example/web.go @@ -1,3 +1,4 @@ +//go:build ignore // +build ignore package main diff --git a/main.go b/main.go index c9de44c..53be4cf 100644 --- a/main.go +++ b/main.go @@ -80,6 +80,8 @@ var procfile = flag.String("f", "Procfile", "proc file") // rpc port number. var port = flag.Uint("p", defaultPort(), "port") +var startRPCServer = flag.Bool("rpc-server", true, "Start an RPC server listening on "+defaultAddr()) + // base directory var basedir = flag.String("basedir", "", "base directory") @@ -264,7 +266,9 @@ func start(ctx context.Context, sig <-chan os.Signal, cfg *config) error { } godotenv.Load() rpcChan := make(chan *rpcMessage, 10) - go startServer(ctx, rpcChan, cfg.Port) + if *startRPCServer { + go startServer(ctx, rpcChan, cfg.Port) + } procsErr := startProcs(sig, rpcChan, cfg.ExitOnError) return procsErr } diff --git a/proc_posix.go b/proc_posix.go index ae813f3..7dbd375 100644 --- a/proc_posix.go +++ b/proc_posix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package main