blob: 837b20436c536587172c708fb5e05d4d2a3e7a33 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
// +build linux
package xid
import "io/ioutil"
func readPlatformMachineID() (string, error) {
b, err := ioutil.ReadFile("/etc/machine-id")
if err != nil || len(b) == 0 {
b, err = ioutil.ReadFile("/sys/class/dmi/id/product_uuid")
}
return string(b), err
}
|