1

我是 Go 新手,并试图用 GPG 运行一个简单的程序,用我的签名文件验证一个文件。

这是我的片段:

out, err := exec.Command("gpg", "--verify", "xyz.json.sig", "xyz.json").Output()
	if err != nil {
		fmt.Printf("%s", err)
		os.Exit(1)
	}
	fmt.Printf("The output is: %s\n", out)

当我执行此操作时,我的输出out为空。如果我从命令行手动运行此验证命令,我将获得有效签名,xyz.json.sig 和 xyz.json 都是我的 go 文件旁边的本地文件。我想念什么?

4

0 回答 0