tencent cloud

피드백

Deployment Methods

마지막 업데이트 시간:2022-04-29 15:55:43

    Deployment Methods

    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.

    Compiling and Packaging

    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.

    • Compile and package on Linux or macOS as follows:
      GOOS=linux GOARCH=amd64 go build -o main main.go
      zip main.zip main
      
    • Compile and package on Windows as follows:
      1. Press Windows + R to open the "Run" window, enter cmd, and press Enter.
      2. Run the following command to compile:
        set GOOS=linux
        set GOARCH=amd64
        go build -o main main.go
        
    1. Use a packaging tool to package the output binary file, which should be placed in the root directory of the zip package.
    문의하기

    고객의 업무에 전용 서비스를 제공해드립니다.

    기술 지원

    더 많은 도움이 필요하시면, 티켓을 통해 연락 바랍니다. 티켓 서비스는 연중무휴 24시간 제공됩니다.

    연중무휴 24시간 전화 지원