Beispiel #1
0
func Hostname() (name string, err Error) {
	s, e := syscall.ComputerName()
	if e != 0 {
		return "", NewSyscallError("ComputerName", e)
	}
	return s, nil
}
Beispiel #2
0
func main() {
	name, _ := syscall.ComputerName()
	println(name)
}