...

Source file src/github.com/mdlayher/socket/export_linux_test.go

Documentation: github.com/mdlayher/socket

     1  //go:build linux
     2  // +build linux
     3  
     4  package socket
     5  
     6  // A NetNS is an exported wrapper for netNS for tests.
     7  type NetNS struct{ *netNS }
     8  
     9  // ThreadNetNS is an exported wrapper for threadNetNS for tests.
    10  func ThreadNetNS() (*NetNS, error) {
    11  	ns, err := threadNetNS()
    12  	if err != nil {
    13  		return nil, err
    14  	}
    15  
    16  	return &NetNS{ns}, nil
    17  }
    18  

View as plain text