|
|
|
|
|
by minieggs
1951 days ago
|
|
The go:embed directive and embed.FS interface are great, as expected. If you're developing an AGPL or similarily licensed application it's incredibly easy to distribute source code with the application. //go:embed main.go go.mod go.sum LICENSE README makefile static/* var sourceCode embed.FS // ... func main() { // ...
http.Handle("/source/", http.StripPrefix("/source/", http.FileServer(http.FS(sourceCode))))
// ...
}
|
|