19 lines
341 B
Go
19 lines
341 B
Go
package hostname
|
|
|
|
// functions to import and export the protobuf
|
|
// data to and from config files
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
// scutil --get HostName
|
|
// scutil --get LocalHostName
|
|
// scutil --get ComputerName
|
|
// scutil --set HostName my-mac.example.com
|
|
|
|
func osGetHostname() (string, error) {
|
|
hostname, err := os.Hostname()
|
|
return hostname, err
|
|
}
|