go:embed 嵌入单个文件

版本新特性 / Go 1.16

// *** before: ***
data, err := ioutil.ReadFile("templates/index.html")
if err != nil {
    log.Fatal(err)
}
// without the file next to the binary the program would not start

// *** in version 1.16: ***
import _ "embed"

//go:embed templates/index.html
var indexHTML string