Source File
switch_posix.go
Belonging Package
net/internal/socktest
// Copyright 2015 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.//go:build !plan9package socktestimport ()func familyString( int) string {switch {case syscall.AF_INET:return "inet4"case syscall.AF_INET6:return "inet6"case syscall.AF_UNIX:return "local"default:return fmt.Sprintf("%d", )}}func typeString( int) string {var stringswitch & 0xff {case syscall.SOCK_STREAM:= "stream"case syscall.SOCK_DGRAM:= "datagram"case syscall.SOCK_RAW:= "raw"case syscall.SOCK_SEQPACKET:= "seqpacket"default:= fmt.Sprintf("%d", &0xff)}if := uint() & ^uint(0xff); != 0 {+= fmt.Sprintf("|%#x", )}return}func protocolString( int) string {switch {case 0:return "default"case syscall.IPPROTO_TCP:return "tcp"case syscall.IPPROTO_UDP:return "udp"default:return fmt.Sprintf("%d", )}}
![]() |
The pages are generated with Golds v0.7.9-preview. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |