Problem to be solved
I want to embed the txt file containing all words into a single binary.
Source of information
Upgrade my project to use go 1.16
Install new go version;
Update my go mod:
1 | go mod edit -go=1.16 |
Code
1 | import _ "embed" |
This will make these two strings available to the package, and the file will be packaged into the single compiled file upon build.