Standard library / net
net.TCPAddr.Network()
Return the transport family name. Expected stdout: 'tcp\n'.
Formal Syntax & Structure
go syntaxgo
func (a *TCPAddr) Network() stringReturn Value
string
Operation result; check errors and validity indicators when returned.
Working Example
Example Snippetgo
package main
import ( "fmt" "net")
func main() { fmt.Println((&net.TCPAddr{IP: net.IPv4(192, 0, 2, 7), Port: 80}).Network()) }
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) }}