github.com/geofffranks/garden-linux@v0.0.0-20160715111146-26c893169cfa/network/hostname_linux.go (about)

     1  package network
     2  
     3  import "syscall"
     4  
     5  type hostNameSetter struct{}
     6  
     7  func newHostname() *hostNameSetter {
     8  	return &hostNameSetter{}
     9  }
    10  
    11  func (*hostNameSetter) SetHostname(hostname string) error {
    12  	return syscall.Sethostname([]byte(hostname))
    13  }