feat: use go:embed to embed templates (#1756)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package generator
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -11,14 +12,8 @@ import (
|
||||
"github.com/zeromicro/go-zero/tools/goctl/util/pathx"
|
||||
)
|
||||
|
||||
const configTemplate = `package config
|
||||
|
||||
import "github.com/zeromicro/go-zero/zrpc"
|
||||
|
||||
type Config struct {
|
||||
zrpc.RpcServerConf
|
||||
}
|
||||
`
|
||||
//go:embed config.tpl
|
||||
var configTemplate string
|
||||
|
||||
// GenConfig generates the configuration structure definition file of the rpc service,
|
||||
// which contains the zrpc.RpcServerConf configuration item by default.
|
||||
|
||||
Reference in New Issue
Block a user