mirror of
https://github.com/golang/go
synced 2024-11-19 04:04:47 -07:00
063f97a611
This commit adds the js/wasm architecture to the os package. Access to the actual file system is supported through Node.js. Updates #18892 Change-Id: I6fa642fb294ca020b2c545649d4324d981aa0408 Reviewed-on: https://go-review.googlesource.com/109977 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
18 lines
440 B
Go
18 lines
440 B
Go
// Copyright 2009 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// +build darwin dragonfly freebsd js,wasm nacl netbsd openbsd
|
|
|
|
package os
|
|
|
|
import "syscall"
|
|
|
|
func hostname() (name string, err error) {
|
|
name, err = syscall.Sysctl("kern.hostname")
|
|
if err != nil {
|
|
return "", NewSyscallError("sysctl kern.hostname", err)
|
|
}
|
|
return name, nil
|
|
}
|