summaryrefslogtreecommitdiff
path: root/get_darwin.go
diff options
context:
space:
mode:
Diffstat (limited to 'get_darwin.go')
-rw-r--r--get_darwin.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/get_darwin.go b/get_darwin.go
new file mode 100644
index 0000000..39cbe0a
--- /dev/null
+++ b/get_darwin.go
@@ -0,0 +1,18 @@
+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
+}