Standard library / net/http

http.ConnState

Describes a server connection lifecycle state. It tracks connections, not individual requests on multiplexed HTTP/2. Expected stdout: 'idle\n'.

Formal Syntax & Structure

go syntaxgo
type ConnState int

Working Example

Example Snippetgo
package main
import (  "fmt"  "net/http")
func main() { var s http.ConnState = http.StateIdle; fmt.Println(s.String()) }
func must[T any](v T, e error) T {  if e != nil {    panic(e)  }  return v}func check(e error) {  if e != nil {    panic(e)  }}
Go Reference