- Documentation
Volcano Engine Function as a Service
Development Guide
Code development
Golang runtime
Deployment methods
Golang runtime
Deployment methods
Deployment methods
Golang functions only support uploading code as ZIP packages. You can either upload a local ZIP file or specify an existing ZIP file in your TOS bucket for upload. The ZIP package must contain a compiled binary file named main that can be executed on the amd64-based Linux platform.
Golang functions support cross-platform compilation by specifying the GOOS and GOARCH parameters. The compilation and packaging methods for Golang functions on different platforms are as follows.
macOS or Linux platforms
On macOS or Linux, you can compile and package the code by running the following commands.
Windows platforms
On Windows, follow these steps to compile and package the code:
- Press the shortcut keys Windows + R to open the Run dialog, then type wt to open the command-line terminal.
- Compile using the following command.
- Use a packaging tool to package the compiled binary main. The main file must be located in the root directory of the ZIP package.
Considerations
- The compiled binary must be named main, and the main file must reside in the root directory of the ZIP package rather than in any subdirectory.
- If your main program depends on other local files (for example, config.yaml), include these dependencies in the package and reference them via relative paths in your code.
- The size of ZIP files uploaded to the veFaaS console must not exceed 256 MiB. If the ZIP file size exceeds 256 MiB, submit a ticket for technical support.
Last updated: 2026.08.19 14:06:05