diff --git a/tests/go/fixtures/multipleprocesses/Procfile b/tests/go/fixtures/multipleprocesses/Procfile new file mode 100644 index 0000000..99bd854 --- /dev/null +++ b/tests/go/fixtures/multipleprocesses/Procfile @@ -0,0 +1,2 @@ +api: api +worker: worker \ No newline at end of file diff --git a/tests/go/fixtures/multipleprocesses/cmd/api/main.go b/tests/go/fixtures/multipleprocesses/cmd/api/main.go new file mode 100644 index 0000000..f88c806 --- /dev/null +++ b/tests/go/fixtures/multipleprocesses/cmd/api/main.go @@ -0,0 +1,31 @@ +package main + +import ( + "fmt" + "net/http" + "os" +) + +func main() { + http.HandleFunc("/", hello) + http.HandleFunc("/healthcheck", healthcheck) + + + port := os.Getenv("PORT") + if port == "" { + port = "8888" + } + + err := http.ListenAndServe(":" + port, nil) + if err != nil { + panic(err) + } +} + +func hello(res http.ResponseWriter, req *http.Request) { + fmt.Fprintln(res, "hello, world!") +} + +func healthcheck(res http.ResponseWriter, req *http.Request) { + fmt.Fprintln(res, "WORKING") +} diff --git a/tests/go/fixtures/multipleprocesses/cmd/worker/main.go b/tests/go/fixtures/multipleprocesses/cmd/worker/main.go new file mode 100644 index 0000000..2b228b3 --- /dev/null +++ b/tests/go/fixtures/multipleprocesses/cmd/worker/main.go @@ -0,0 +1,14 @@ +package main + + +import ( + "fmt" + "time" +) + +func main() { + for { + fmt.Println("worker") + time.Sleep(time.Minute) + } +} diff --git a/tests/go/fixtures/multipleprocesses/go.mod b/tests/go/fixtures/multipleprocesses/go.mod new file mode 100644 index 0000000..7c90f14 --- /dev/null +++ b/tests/go/fixtures/multipleprocesses/go.mod @@ -0,0 +1,3 @@ +module multipleprocesses + +go 1.22.2