func handler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Custom-Header", "Hello World!") fmt.Fprintf(w, "Response with custom header") }
func handler(w http.ResponseWriter, r *http.Request) { w.Header().Add("Set-Cookie", "sessionID=123456789") w.Header().Add("Set-Cookie", "loggedIn=true") fmt.Fprintf(w, "Added multiple values to the Set-Cookie header") }In this example, the `Add()` method is used to add multiple values to the `Set-Cookie` header. These examples show how the go http ResponseWriter Header can be used to add or modify HTTP headers. It is a part of the http package in the Go standard library.