Grokking Advanced Go
Vote

0% completed

​

Embedding Files

A deployment copies one binary to a new server, and the first request fails because templates/receipt.html does not exist there. The program compiled, and its tests passed on a machine that had the file.

A Go program that reads a template or a SQL file at run time has this risk. The binary works only if a separate file is present at the right path on the machine that runs it, and a deployment can leave that file out. The Go build can instead place the file inside the binary, so the program and its data are one file.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content