2015-11-14 17:03:02 -05:00
|
|
|
package platform
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
|
2017-07-26 17:42:13 -04:00
|
|
|
"github.com/sirupsen/logrus"
|
2015-11-14 17:03:02 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
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
|
2015-11-19 08:55:57 -05:00
|
|
|
Architecture, err = runtimeArchitecture()
|
2015-11-14 17:03:02 -05:00
|
|
|
if err != nil {
|
2016-04-09 09:18:15 -04:00
|
|
|
logrus.Errorf("Could not read system architecture info: %v", err)
|
2015-11-14 17:03:02 -05:00
|
|
|
}
|
|
|
|
OSType = runtime.GOOS
|
|
|
|
}
|