platform.go 601 B

12345678910111213141516171819202122232425
  1. // Package platform provides helper function to get the runtime architecture
  2. // for different platforms.
  3. package platform // import "github.com/docker/docker/pkg/platform"
  4. import (
  5. "runtime"
  6. "github.com/sirupsen/logrus"
  7. )
  8. var (
  9. // Architecture holds the runtime architecture of the process.
  10. Architecture string
  11. // OSType holds the runtime operating system type (Linux, …) of the process.
  12. OSType string
  13. )
  14. func init() {
  15. var err error
  16. Architecture, err = runtimeArchitecture()
  17. if err != nil {
  18. logrus.Errorf("Could not read system architecture info: %v", err)
  19. }
  20. OSType = runtime.GOOS
  21. }