首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >SCF服务示例找不到包cloudfunction package?

SCF服务示例找不到包cloudfunction package?

提问于 2019-06-04 08:37:23
回答 1关注 0查看 544

代码是官方文档里的:

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)

}

编译报错:

cannot find package "github.com/tencentyun/scf-go-lib/cloudfunction" in any of:

/usr/local/Cellar/go/1.12.5/libexec/src/github.com/tencentyun/scf-go-lib/cloudfunction (from $GOROOT)

/Users/ext.richie.zhu/go/src/github.com/tencentyun/scf-go-lib/cloudfunction (from $GOPATH)

相关文章

相似问题

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