Ask coding questions

← Back to all posts
IS there a way to download binaries so I can upload it to AWS Lambda and run
closingtime (1)


I am new to Replit and Go language. Here is what I am trying to accomplish
1. Write code in replit, generate binaries using console
2. Download the binaries and upload it to AWS Lambda because that is where I am trying to ultimately run my program

However, when I use download functionality on replit, it only gives me regular files but not binaries. Is there a way to accomplish this?

Baconman321 (1097)

You can download the files as a zip. When you compile go, it
creates a single executable binary that you can find in the downloaded zip file.

Note that if you just created your program, then you have to build it before the binary shows up.

There are two ways to do this.

The first way is to execute go build main.go (you can omit the main.go in the build command, but it is better to do it with the main.go for later on in your programming life). This will build from the source and create a single executable file.

The second way is to click the run button, which automatically creates the executable and runs it.

Either way will give you the executable called simply main (no file extension suffix).

One way also executes the file, and the other one simply builds it without doing anything further.