Go 1.22 brings two enhancements to the net/http package’s router: method matching and wildcards. These features let you express common routes as patterns instead of Go code. Although they are simple to explain and use, it was a challenge to come up with the right rules for selecting the winning pattern when several match a request. We made these changes as part of our continuing effort to ...
Before Go 1.22, if you wanted advanced routing features like method routing, path parameters, etc., you wrote a lot of boilerplate code or reached out to an external library like Gorilla Mux or another web framework.
This tutorial provides a basic Go programmer’s introduction to working with gRPC. By walking through this example you’ll learn how to: Define a service in a .proto file. Generate server and client code using the protocol buffer compiler. Use the Go gRPC API to write a simple client and server for your service. It assumes that you have read the Introduction to gRPC and are familiar with ...
Mat Ryer, principal engineer at Grafana Labs and host of the Go Time podcast, shares what he's learned from more than a dozen years of writing HTTP services in Go.
An FS is a read-only collection of files, usually initialized with a //go:embed directive. When declared without a //go:embed directive, an FS is an empty file system. An FS is a read-only value, so it is safe to use from multiple goroutines simultaneously and also safe to assign values of type FS to each other. FS implements fs.FS, so it can be used with any package that understands file ...