Go package to run an HTTP server on Cloudflare Workers.
See the codeworkers-go is a Go module to run an HTTP server written in Go on Cloudflare Workers. Its root package is workers.Documentation: https://workers-go.syumai.dev — feature support, per-platform guides, the full binding reference, and the FAQ live there.
go get github.com/syumai/workers-go
Implement your http.Handler and give it to workers.Serve().
func main() {
http.HandleFunc("/hello", func (w http.ResponseWriter, req *http.Request) { ... })
workers.Serve(nil) // if nil is given, http.DefaultServeMux is used.
}
Deploy to Cloudflare button.npm create cloudflare@latest -- --template github.com/syumai/workers-go/_templates/cloudflare/worker-go
cd my-app
go mod init
go mod tidy
npm start
curl http://localhost:8787/hello
You will see "Hello!" as the response.
exp/cloudflare) — bindings auto-generated from @cloudflare/workers-typeshttp.Handler via Deno.serve_examples — a runnable project for almost every featureexp/cloudflare — experimental generated bindings and how they are produced(top 24 of 30)
329 followers · starred Oct 2023
2,224 followers · starred Sep 2026
972 followers · starred Mar 2026
197 followers · starred Feb 2026
Go package to run an HTTP server on Cloudflare Workers.
See the codeworkers-go is a Go module to run an HTTP server written in Go on Cloudflare Workers. Its root package is workers.Documentation: https://workers-go.syumai.dev — feature support, per-platform guides, the full binding reference, and the FAQ live there.
go get github.com/syumai/workers-go
Implement your http.Handler and give it to workers.Serve().
func main() {
http.HandleFunc("/hello", func (w http.ResponseWriter, req *http.Request) { ... })
workers.Serve(nil) // if nil is given, http.DefaultServeMux is used.
}
Deploy to Cloudflare button.npm create cloudflare@latest -- --template github.com/syumai/workers-go/_templates/cloudflare/worker-go
cd my-app
go mod init
go mod tidy
npm start
curl http://localhost:8787/hello
You will see "Hello!" as the response.
exp/cloudflare) — bindings auto-generated from @cloudflare/workers-typeshttp.Handler via Deno.serve_examples — a runnable project for almost every featureexp/cloudflare — experimental generated bindings and how they are produced(top 24 of 30)
329 followers · starred Oct 2023
2,224 followers · starred Sep 2026
972 followers · starred Mar 2026
197 followers · starred Feb 2026