Add pkg/parsers/architecture and pkg/platform
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
6dab26120b
commit
4ee0608373
4 changed files with 118 additions and 0 deletions
23
platform/platform.go
Normal file
23
platform/platform.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package platform
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
)
|
||||
|
||||
var (
|
||||
// Architecture holds the runtime architecture of the process.
|
||||
Architecture string
|
||||
// OSType holds the runtime operating system type (Linux, …) of the process.
|
||||
OSType string
|
||||
)
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
Architecture, err = GetRuntimeArchitecture()
|
||||
if err != nil {
|
||||
logrus.Errorf("Could no read system architecture info: %v", err)
|
||||
}
|
||||
OSType = runtime.GOOS
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue