mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
MAINT: Adopt go 1.16's embed feature (#1162)
* MAINT: Switch from esc to embed * Simplify * Update minimum go version in docs and pipelines * go generate
This commit is contained in:
@@ -2,32 +2,9 @@ package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/mjibson/esc/embed"
|
||||
)
|
||||
|
||||
func main() {
|
||||
conf := &embed.Config{
|
||||
ModTime: "0",
|
||||
OutputFile: "pkg/js/static.go",
|
||||
Package: "js",
|
||||
Prefix: "pkg/js",
|
||||
Private: true,
|
||||
Files: []string{`pkg/js/helpers.js`},
|
||||
}
|
||||
|
||||
var err error
|
||||
out := os.Stdout
|
||||
if conf.OutputFile != "" {
|
||||
if out, err = os.Create(conf.OutputFile); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer out.Close()
|
||||
}
|
||||
|
||||
embed.Run(conf, out)
|
||||
|
||||
if err := generateFeatureMatrix(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user