github.com/nyan233/littlerpc@v0.4.6-0.20230316182519-0c8d5c48abaf/cmd/pxtor/template.go (about)

     1  package main
     2  
     3  import (
     4  	"embed"
     5  	"fmt"
     6  )
     7  
     8  var (
     9  	//go:embed template
    10  	templateFs embed.FS
    11  
    12  	BeforeCodeTemplate string
    13  )
    14  
    15  func init() {
    16  	bfData, err := templateFs.ReadFile("template/beforecode.gohtml")
    17  	if err != nil {
    18  		panic(err)
    19  	}
    20  	BeforeCodeTemplate = fmt.Sprintf(string(bfData), "\n", "\n")
    21  }