13 lines
190 B
Go
13 lines
190 B
Go
//go:build linux
|
|
|
|
package system
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
func SetHostname(hostname string) error {
|
|
if hostname == "" {
|
|
return nil
|
|
}
|
|
return unix.Sethostname([]byte(hostname))
|
|
}
|