Standard library / net
net.IPAddr.Network()
Return ip as the network type. Expected stdout: 'ip\n'.
Formal Syntax & Structure
go syntaxgo
func (a *IPAddr) 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.IPAddr{IP: net.IPv4(192, 0, 2, 7)}).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) }}