The Go language does not support online editing, but only supports the. zip method (including the upload method of the specified OSS path). Therefore, you must compile and package it locally. This topic describes how to package the Function Compute official Go SDK library with your code.
Install the Go locale. We recommend that you use Go 1.8 or later.
Compile and deploy (Linux or macOS)
- Download the Function Compute Go SDK library.
go get github.com/aliyun/fc-runtime-go-sdk
- Compile the file.
GOOS=linux go build -o main
For Linux operating systems, you may also need to configure
GOOS=linux CGO_ENABLED=0 go build
- The package file.
zip function.zip main