A function in the Go environment can only be uploaded as a zip package. You can choose to upload the local zip package or use COS to import the package. The package should include the compiled executable binary file.
Cross-platform Go compilation can be achieved by specifying OS and ARCH on any platform, so it can be done on Linux, Windows, or macOS.
GOOS=linux GOARCH=amd64 go build -o main main.go
zip main.zip main
set GOOS=linux
set GOARCH=amd64
go build -o main main.go
Was this page helpful?