super-l / machine-code

GO语言实现的跨平台机器码(硬件信息)获取程序,包括PlatformUUID、SerialNumber、MAC网卡信息、CPUID信息等。同时支持windows、Linux、mac等系统!
56 stars 26 forks source link

在Linux上报错提示panic: exec: "dmidecode": executable file not found in $PATH #4

Open fxaxg opened 3 weeks ago

fxaxg commented 3 weeks ago

代码如下:

// GetMachineCode 获取机器码函数
func GetMachineCode() (string, error) {
    platformUUID, err := machine.GetPlatformUUID()
    if err != nil {
        return "", err
    }
    // 解析 platformUUID 并返回
    return string(platformUUID), nil

}

使用goreleaser打包到windows上运行正常,在Linux上运行提示panic: exec: "dmidecode": executable file not found in $PATH,在mac上提示sysctl: unknown oid 'machdep.cpu.signature'