【发布时间】:2022-10-18 17:46:09
【问题描述】:
我在部署云功能时遇到问题,因为我的一个包间接使用了golang.org/x/sys
当使用此版本时,CF 构建通过上述任何似乎都失败了
# golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4
但是在每次运行go get -u ./... 之后,我们都会获得更新的版本,并且 CF 构建失败并出现错误
2022-10-02 09:03:07.208 CESTStep #1 - "build": # cloudfunctionissue/vendor/golang.org/x/sys/unix
2022-10-02 09:03:07.208 CESTStep #1 - "build": src/cloudfunctionissue/vendor/golang.org/x/sys/unix/syscall.go:83:16: undefined: unsafe.Slice
2022-10-02 09:03:07.208 CESTStep #1 - "build": src/cloudfunctionissue/vendor/golang.org/x/sys/unix/syscall_linux.go:2255:9: undefined: unsafe.Slice
2022-10-02 09:03:07.208 CESTStep #1 - "build": src/cloudfunctionissue/vendor/golang.org/x/sys/unix/syscall_unix.go:118:7: undefined: unsafe.Slice
2022-10-02 09:03:07.208 CESTStep #1 - "build": src/cloudfunctionissue/vendor/golang.org/x/sys/unix/sysvshm_unix.go:33:7: undefined: unsafe.Slice
似乎这个文档对我的问题解释不够https://cloud.google.com/functions/docs/writing/specifying-dependencies-go#using_a_vendor_directory
【问题讨论】: