thefack
V2EX  ›  问与答

初使用 腾讯云函数,为什么我连个 helloworld 都通不过。。

  •  
  •   thefack · Sep 26, 2020 · 2532 views
    This topic created in 2134 days ago, the information mentioned may be changed or developed.

    使用的 golang,按照链接中的步骤 https://cloud.tencent.com/document/product/583/18032#ReturnValue

    • 在本地新建工程后,直接复制粘贴“函数形态”里面的代码
    • go get
    • go build -o main main.go 后压缩上传
    • 在“函数代码”中上传.zip 文件,点“保存”
    • 在“函数管理”中点“测试”,却提示“UserCodeError”

    我仔细确认了过程,没发现步骤或代码有问题,为什么用它提供的.zip 文件测试通过,而我自己编译上传的.zip 文件却不行。。

    hundan
        1
    hundan  
       Sep 26, 2020 via iPhone
    平台? Windows ?
    thefack
        2
    thefack  
    OP
       Sep 26, 2020
    @hundan 是 Windows,已设置过 set GOOS=linux
    set GOARCH=amd64 坏境变量。
    Lampo1225
        3
    Lampo1225  
       Sep 27, 2020
    这个问题可以提工单问问,他们或许能解决~
    thefack
        4
    thefack  
    OP
       Sep 27, 2020
    @Lampo1225 感谢回复,已解决。我用的 powershell,却用 cmd 的方法设置交叉编译环境,导致的错误。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2722 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 11:56 · PVG 19:56 · LAX 04:56 · JFK 07:56
    ♥ Do have faith in what you're doing.