title: "Golang Embed资源并释放resource"
date: 2021-03-07T15:42:58+08:00
draft: true
tags: ['go']
author: "dadigang"
author_cn: "大地缸"
personal: "http://www.real007.cn"
关于作者
package main
import (
"embed"
"fmt"
"io"
"os"
)
//go:embed dict.txt
var f embed.FS
func main() {
fs, _ := os.Create("dictionary.txt")
helloFile, _ := f.Open("dict.txt")
io.Copy(fs, helloFile)
fmt.Println()
}
有疑问加站长微信联系(非本文作者)