by minieggs · 5y ago · 0 comments
//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))))
// ...
} package main
import (
_ "embed"
"fmt"
)
//go:embed quine.go
var src string
func main() {
fmt.Print(src)
}