我想使用 Windows 证书商店的证书包,谁能告诉我我在这里做错了什么?
我的代码:
package main
import (
"fmt"
"runtime"
"github.com/google/certtostore"
)
type certmgr struct {
certToStore certtostore.CertStorage
}
func main() {
if runtime.GOOS == "windows" {
var cert certmgr
certInStore, err := cert.certToStore.Cert()
if err != nil {
fmt.Println("message", "Error in getting system store certificate ...")
}
fmt.Println("Windows System Store Certificate", *certInStore)
}
}
我得到的错误:
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0xbe2dda]
goroutine 1 [running]:
main.main()
C:/Users/prajwal.bhagat/go/src/phoenix/mainsvc/cmd/main/test.go:17 +0x1a
exit status 2
白板的微信
www说
随时随地看视频慕课网APP
相关分类