Closed yuanbaode closed 2 years ago
Probably you can't delete it because it is defined in the slice.
https://github.com/smallnest/gen/blob/dcfa6a9e671f82b302467334010169e19d0ca4a4/dbmeta/meta.go#L253
In my case, I added the delete flag and ran the sed command.
\n
is included so that you can delete only the relevant lines.
{{workdir}}/templates/model.go.tmpl
package {{.modelPackageName}}
import "time"
const (
{{singular .StructName}}ModelName = "{{singular .StructName}}"
{{singular .StructName}}TableName = "{{toSnakeCase .StructName}}"
)
type {{singular .StructName}} struct {
{{range .TableInfo.Fields}}commentDeleteFlag{{.}}
{{end}}
}
$ gen --templateDir=./templates --connstr=... && sed -i "/commentDeleteFlag/d" $$OUT_DIR/*
how to ignore annotations above