Skip to content

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

@fxaxg

Description

@fxaxg

代码如下:

// 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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions