您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

21 行
386 B

  1. package platform_device_id
  2. import (
  3. // "fmt"
  4. "os/exec"
  5. "github.com/pkg/errors"
  6. )
  7. func getPlatformDeviceId() (deviceId string, err error) {
  8. //dmidecode -s system-uuid
  9. arg := []string{"-s","system-uuid"}
  10. cmd := exec.Command("dmidecode", arg...)
  11. d, err := cmd.CombinedOutput()
  12. if err != nil {
  13. return "", errors.Wrap(err, "failed to get deviceId")
  14. }
  15. return string(d), nil
  16. }