首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >SCF 的 golang 默认 example 无法运行?

SCF 的 golang 默认 example 无法运行?

提问于 2018-11-07 21:45:48
回答 1关注 0查看 468

go version go1.8 windows/amd64

example 代码:

代码语言:go
复制
package main

import (
	"context"
	"fmt"

	"github.com/tencentyun/scf-go-lib/cloudfunction"
)

type DefineEvent struct {
	// test event define
	Key1 string `json:"key1"`
	Key2 string `json:"key2"`
}

func hello(ctx context.Context, event DefineEvent) (string, error) {
	fmt.Println("key1:", event.Key1)
	fmt.Println("key2:", event.Key2)
	return fmt.Sprintf("Hello %s!", event.Key1), nil
}

func main() {
	// Make the handler available for Remote Procedure Call by Cloud Function
	cloudfunction.Start(hello)
}

zip 包:

测试结果:失败

代码语言:go
复制
返回结果:
{"errorCode":-1,"errorMessage":"Internal server error"}

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档