go test -v 有问题, 系统为Mac OS 10.14 go1.13.8

来源:5-1 实现主服务测试用例

andyhui686666

2020-02-17 12:13

$ go test -v

# crypto/x509

/usr/local/go/src/crypto/x509/root_cgo_darwin.go:29:48: error: use of undeclared identifier 'kSecPolicyOid'

        if (CFDictionaryGetValueIfPresent(properties, kSecPolicyOid, (const void **)&value)) {

                                                      ^

/usr/local/go/src/crypto/x509/root_cgo_darwin.go:30:26: error: use of undeclared identifier 'kSecPolicyAppleSSL'; did you mean 'SecPolicyCreateSSL'?

                isSSL = CFEqual(value, kSecPolicyAppleSSL);

                                       ^~~~~~~~~~~~~~~~~~

                                       SecPolicyCreateSSL

/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h:103:14: note: 'SecPolicyCreateSSL' declared here

SecPolicyRef SecPolicyCreateSSL(Boolean server, CFStringRef hostname);

             ^

2 errors generated.

FAIL    github.com/xxxx/shorturl [build failed]


写回答 关注

1回答

  • 慕梦前来
    2022-07-19 19:53:04

    这是系统对应的版本不同引起的

Go开发短地址服务

2小时带你通过GO语言实现短地址服务。

5565 学习 · 27 问题

查看课程

相似问题