Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
uname-it: found the link to find add the blanks
Browse files Browse the repository at this point in the history
  • Loading branch information
fenollp committed Jan 23, 2018
1 parent 5c80245 commit efaf03f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,47 @@ func (p *Platform) String() string {
}

/// Like `uname -s`
// Matches https://github.com/golang/go/blob/master/src/go/build/syslist.go
func (p *Platform) OSUname() string {
return map[string]string{
//"android":
"darwin": "Darwin",
"dragonfly": "DragonFly",
"freebsd": "FreeBSD",
"linux": "Linux",
//"nacl":
"netbsd": "NetBSD",
"openbsd": "OpenBSD",
"plan9": "Plan9",
"solaris": "SunOS",
"windows": "Windows",
//"zos":
}[p.OS]
}

/// Like `uname -m`
// Matches https://github.com/golang/go/blob/master/src/go/build/syslist.go
func (p *Platform) ArchUname() string {
return map[string]string{
"386": "i386",
"amd64": "x86_64",
//"amd64p32":
"arm": "arm",
//"armbe":
"arm64": "aarch64",
//"arm64be":
"ppc64": "ppc64",
"ppc64le": "ppc64le",
//"mips":
//"mipsle":
//"mips64":
//"mips64p32":
//"mips64p32le":
//"ppc":
//"s390":
//"s390x":
//"sparc":
//"sparc64":
}[p.Arch]
}

Expand Down

0 comments on commit efaf03f

Please sign in to comment.