v0.0.402 add PackageName() and TypeName() to enums_codegen
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m12s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m12s
This commit is contained in:
parent
ed53f297bd
commit
409d6e108d
4
TODO.md
4
TODO.md
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
- cronext
|
- cronext
|
||||||
|
|
||||||
- rfctime.DateOnly
|
|
||||||
- rfctime.HMSTimeOnly
|
- rfctime.HMSTimeOnly
|
||||||
- rfctime.NanoTimeOnly
|
- rfctime.NanoTimeOnly
|
||||||
|
|
||||||
|
- remove sqlx dependency from sq (unmaintained, and mostly superseeded by our own stuff?)
|
||||||
|
- Move DBLogger and DBPreprocessor to sq
|
@ -26,6 +26,10 @@ type CSIDDef struct {
|
|||||||
Prefix string
|
Prefix string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type CSIDGenOptions struct {
|
||||||
|
DebugOutput *bool
|
||||||
|
}
|
||||||
|
|
||||||
var rexCSIDPackage = rext.W(regexp.MustCompile(`^package\s+(?P<name>[A-Za-z0-9_]+)\s*$`))
|
var rexCSIDPackage = rext.W(regexp.MustCompile(`^package\s+(?P<name>[A-Za-z0-9_]+)\s*$`))
|
||||||
|
|
||||||
var rexCSIDDef = rext.W(regexp.MustCompile(`^\s*type\s+(?P<name>[A-Za-z0-9_]+)\s+string\s*//\s*(@csid:type)\s+\[(?P<prefix>[A-Z0-9]{3})].*$`))
|
var rexCSIDDef = rext.W(regexp.MustCompile(`^\s*type\s+(?P<name>[A-Za-z0-9_]+)\s+string\s*//\s*(@csid:type)\s+\[(?P<prefix>[A-Z0-9]{3})].*$`))
|
||||||
@ -35,7 +39,9 @@ var rexCSIDChecksumConst = rext.W(regexp.MustCompile(`const ChecksumCharsetIDGen
|
|||||||
//go:embed csid-generate.template
|
//go:embed csid-generate.template
|
||||||
var templateCSIDGenerateText string
|
var templateCSIDGenerateText string
|
||||||
|
|
||||||
func GenerateCharsetIDSpecs(sourceDir string, destFile string) error {
|
func GenerateCharsetIDSpecs(sourceDir string, destFile string, opt CSIDGenOptions) error {
|
||||||
|
|
||||||
|
debugOutput := langext.Coalesce(opt.DebugOutput, false)
|
||||||
|
|
||||||
files, err := os.ReadDir(sourceDir)
|
files, err := os.ReadDir(sourceDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -81,13 +87,18 @@ func GenerateCharsetIDSpecs(sourceDir string, destFile string) error {
|
|||||||
pkgname := ""
|
pkgname := ""
|
||||||
|
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
|
if debugOutput {
|
||||||
fmt.Printf("========= %s =========\n\n", f.Name())
|
fmt.Printf("========= %s =========\n\n", f.Name())
|
||||||
fileIDs, pn, err := processCSIDFile(sourceDir, path.Join(sourceDir, f.Name()))
|
}
|
||||||
|
|
||||||
|
fileIDs, pn, err := processCSIDFile(sourceDir, path.Join(sourceDir, f.Name()), debugOutput)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if debugOutput {
|
||||||
fmt.Printf("\n")
|
fmt.Printf("\n")
|
||||||
|
}
|
||||||
|
|
||||||
allIDs = append(allIDs, fileIDs...)
|
allIDs = append(allIDs, fileIDs...)
|
||||||
|
|
||||||
@ -113,7 +124,7 @@ func GenerateCharsetIDSpecs(sourceDir string, destFile string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func processCSIDFile(basedir string, fn string) ([]CSIDDef, string, error) {
|
func processCSIDFile(basedir string, fn string, debugOutput bool) ([]CSIDDef, string, error) {
|
||||||
file, err := os.Open(fn)
|
file, err := os.Open(fn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
@ -155,7 +166,11 @@ func processCSIDFile(basedir string, fn string) ([]CSIDDef, string, error) {
|
|||||||
Name: match.GroupByName("name").Value(),
|
Name: match.GroupByName("name").Value(),
|
||||||
Prefix: match.GroupByName("prefix").Value(),
|
Prefix: match.GroupByName("prefix").Value(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if debugOutput {
|
||||||
fmt.Printf("Found ID definition { '%s' }\n", def.Name)
|
fmt.Printf("Found ID definition { '%s' }\n", def.Name)
|
||||||
|
}
|
||||||
|
|
||||||
ids = append(ids, def)
|
ids = append(ids, def)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,10 +34,10 @@ func TestGenerateCSIDSpecs(t *testing.T) {
|
|||||||
_, err = cmdext.Runner("tar").Arg("-xvzf").Arg(tmpFile).Arg("-C").Arg(tmpDir).FailOnExitCode().FailOnTimeout().Timeout(time.Minute).Run()
|
_, err = cmdext.Runner("tar").Arg("-xvzf").Arg(tmpFile).Arg("-C").Arg(tmpDir).FailOnExitCode().FailOnTimeout().Timeout(time.Minute).Run()
|
||||||
tst.AssertNoErr(t, err)
|
tst.AssertNoErr(t, err)
|
||||||
|
|
||||||
err = GenerateCharsetIDSpecs(tmpDir, tmpDir+"/csid_gen.go")
|
err = GenerateCharsetIDSpecs(tmpDir, tmpDir+"/csid_gen.go", CSIDGenOptions{DebugOutput: langext.PTrue})
|
||||||
tst.AssertNoErr(t, err)
|
tst.AssertNoErr(t, err)
|
||||||
|
|
||||||
err = GenerateCharsetIDSpecs(tmpDir, tmpDir+"/csid_gen.go")
|
err = GenerateCharsetIDSpecs(tmpDir, tmpDir+"/csid_gen.go", CSIDGenOptions{DebugOutput: langext.PTrue})
|
||||||
tst.AssertNoErr(t, err)
|
tst.AssertNoErr(t, err)
|
||||||
|
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
@ -37,6 +37,11 @@ type EnumDef struct {
|
|||||||
Values []EnumDefVal
|
Values []EnumDefVal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type EnumGenOptions struct {
|
||||||
|
DebugOutput *bool
|
||||||
|
GoFormat *bool
|
||||||
|
}
|
||||||
|
|
||||||
var rexEnumPackage = rext.W(regexp.MustCompile(`^package\s+(?P<name>[A-Za-z0-9_]+)\s*$`))
|
var rexEnumPackage = rext.W(regexp.MustCompile(`^package\s+(?P<name>[A-Za-z0-9_]+)\s*$`))
|
||||||
|
|
||||||
var rexEnumDef = rext.W(regexp.MustCompile(`^\s*type\s+(?P<name>[A-Za-z0-9_]+)\s+(?P<type>[A-Za-z0-9_]+)\s*//\s*(@enum:type).*$`))
|
var rexEnumDef = rext.W(regexp.MustCompile(`^\s*type\s+(?P<name>[A-Za-z0-9_]+)\s+(?P<type>[A-Za-z0-9_]+)\s*//\s*(@enum:type).*$`))
|
||||||
@ -48,7 +53,7 @@ var rexEnumChecksumConst = rext.W(regexp.MustCompile(`const ChecksumEnumGenerato
|
|||||||
//go:embed enum-generate.template
|
//go:embed enum-generate.template
|
||||||
var templateEnumGenerateText string
|
var templateEnumGenerateText string
|
||||||
|
|
||||||
func GenerateEnumSpecs(sourceDir string, destFile string) error {
|
func GenerateEnumSpecs(sourceDir string, destFile string, opt EnumGenOptions) error {
|
||||||
|
|
||||||
oldChecksum := "N/A"
|
oldChecksum := "N/A"
|
||||||
if _, err := os.Stat(destFile); !os.IsNotExist(err) {
|
if _, err := os.Stat(destFile); !os.IsNotExist(err) {
|
||||||
@ -61,7 +66,7 @@ func GenerateEnumSpecs(sourceDir string, destFile string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gocode, _, changed, err := _generateEnumSpecs(sourceDir, destFile, oldChecksum, true)
|
gocode, _, changed, err := _generateEnumSpecs(sourceDir, destFile, oldChecksum, langext.Coalesce(opt.GoFormat, true), langext.Coalesce(opt.DebugOutput, false))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -78,7 +83,7 @@ func GenerateEnumSpecs(sourceDir string, destFile string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func _generateEnumSpecs(sourceDir string, destFile string, oldChecksum string, gofmt bool) (string, string, bool, error) {
|
func _generateEnumSpecs(sourceDir string, destFile string, oldChecksum string, gofmt bool, debugOutput bool) (string, string, bool, error) {
|
||||||
|
|
||||||
files, err := os.ReadDir(sourceDir)
|
files, err := os.ReadDir(sourceDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -113,13 +118,18 @@ func _generateEnumSpecs(sourceDir string, destFile string, oldChecksum string, g
|
|||||||
pkgname := ""
|
pkgname := ""
|
||||||
|
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
|
if debugOutput {
|
||||||
fmt.Printf("========= %s =========\n\n", f.Name())
|
fmt.Printf("========= %s =========\n\n", f.Name())
|
||||||
fileEnums, pn, err := processEnumFile(sourceDir, path.Join(sourceDir, f.Name()))
|
}
|
||||||
|
|
||||||
|
fileEnums, pn, err := processEnumFile(sourceDir, path.Join(sourceDir, f.Name()), debugOutput)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", false, err
|
return "", "", false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if debugOutput {
|
||||||
fmt.Printf("\n")
|
fmt.Printf("\n")
|
||||||
|
}
|
||||||
|
|
||||||
allEnums = append(allEnums, fileEnums...)
|
allEnums = append(allEnums, fileEnums...)
|
||||||
|
|
||||||
@ -146,7 +156,7 @@ func _generateEnumSpecs(sourceDir string, destFile string, oldChecksum string, g
|
|||||||
return string(fdata), newChecksum, true, nil
|
return string(fdata), newChecksum, true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func processEnumFile(basedir string, fn string) ([]EnumDef, string, error) {
|
func processEnumFile(basedir string, fn string, debugOutput bool) ([]EnumDef, string, error) {
|
||||||
file, err := os.Open(fn)
|
file, err := os.Open(fn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
@ -190,8 +200,11 @@ func processEnumFile(basedir string, fn string) ([]EnumDef, string, error) {
|
|||||||
Values: make([]EnumDefVal, 0),
|
Values: make([]EnumDefVal, 0),
|
||||||
}
|
}
|
||||||
enums = append(enums, def)
|
enums = append(enums, def)
|
||||||
|
|
||||||
|
if debugOutput {
|
||||||
fmt.Printf("Found enum definition { '%s' -> '%s' }\n", def.EnumTypeName, def.Type)
|
fmt.Printf("Found enum definition { '%s' -> '%s' }\n", def.EnumTypeName, def.Type)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if match, ok := rexEnumValueDef.MatchFirst(line); ok {
|
if match, ok := rexEnumValueDef.MatchFirst(line); ok {
|
||||||
typename := match.GroupByName("type").Value()
|
typename := match.GroupByName("type").Value()
|
||||||
@ -230,19 +243,24 @@ func processEnumFile(basedir string, fn string) ([]EnumDef, string, error) {
|
|||||||
if v.EnumTypeName == typename {
|
if v.EnumTypeName == typename {
|
||||||
enums[i].Values = append(enums[i].Values, def)
|
enums[i].Values = append(enums[i].Values, def)
|
||||||
found = true
|
found = true
|
||||||
|
|
||||||
|
if debugOutput {
|
||||||
if def.Description != nil {
|
if def.Description != nil {
|
||||||
fmt.Printf("Found enum value [%s] for '%s' ('%s')\n", def.Value, def.VarName, *def.Description)
|
fmt.Printf("Found enum value [%s] for '%s' ('%s')\n", def.Value, def.VarName, *def.Description)
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("Found enum value [%s] for '%s'\n", def.Value, def.VarName)
|
fmt.Printf("Found enum value [%s] for '%s'\n", def.Value, def.VarName)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !found {
|
if !found {
|
||||||
|
if debugOutput {
|
||||||
fmt.Printf("Found non-enum value [%s] for '%s' ( looks like enum value, but no matching @enum:type )\n", def.Value, def.VarName)
|
fmt.Printf("Found non-enum value [%s] for '%s' ( looks like enum value, but no matching @enum:type )\n", def.Value, def.VarName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return enums, pkgname, nil
|
return enums, pkgname, nil
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@ import "gogs.mikescher.com/BlackForestBytes/goext/enums"
|
|||||||
|
|
||||||
const ChecksumEnumGenerator = "{{.Checksum}}" // GoExtVersion: {{.GoextVersion}}
|
const ChecksumEnumGenerator = "{{.Checksum}}" // GoExtVersion: {{.GoextVersion}}
|
||||||
|
|
||||||
|
{{ $pkgname := .PkgName }}
|
||||||
|
|
||||||
{{range .Enums}}
|
{{range .Enums}}
|
||||||
|
|
||||||
{{ $hasStr := ( . | hasStr ) }}
|
{{ $hasStr := ( . | hasStr ) }}
|
||||||
@ -97,6 +99,14 @@ func (e {{.EnumTypeName}}) VarName() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (e {{.EnumTypeName}}) TypeName() string {
|
||||||
|
return "{{$typename}}"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e {{.EnumTypeName}}) PackageName() string {
|
||||||
|
return "{{$pkgname }}"
|
||||||
|
}
|
||||||
|
|
||||||
func (e {{.EnumTypeName}}) Meta() enums.EnumMetaValue {
|
func (e {{.EnumTypeName}}) Meta() enums.EnumMetaValue {
|
||||||
{{if $hasDescr}} return enums.EnumMetaValue{VarName: e.VarName(), Value: e, Description: langext.Ptr(e.Description())} {{else}} return enums.EnumMetaValue{VarName: e.VarName(), Value: e, Description: nil} {{end}}
|
{{if $hasDescr}} return enums.EnumMetaValue{VarName: e.VarName(), Value: e, Description: langext.Ptr(e.Description())} {{else}} return enums.EnumMetaValue{VarName: e.VarName(), Value: e, Description: nil} {{end}}
|
||||||
}
|
}
|
||||||
@ -135,3 +145,11 @@ func {{.EnumTypeName}}ValuesDescriptionMeta() []enums.EnumDescriptionMetaValue {
|
|||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
// ================================ ================= ================================
|
||||||
|
|
||||||
|
func AllPackageEnums() []enums.Enum {
|
||||||
|
return []enums.Enum{ {{range .Enums}}
|
||||||
|
{{.EnumTypeName}}, {{end}}
|
||||||
|
}
|
||||||
|
}
|
@ -37,10 +37,10 @@ func TestGenerateEnumSpecs(t *testing.T) {
|
|||||||
_, err = cmdext.Runner("tar").Arg("-xvzf").Arg(tmpFile).Arg("-C").Arg(tmpDir).FailOnExitCode().FailOnTimeout().Timeout(time.Minute).Run()
|
_, err = cmdext.Runner("tar").Arg("-xvzf").Arg(tmpFile).Arg("-C").Arg(tmpDir).FailOnExitCode().FailOnTimeout().Timeout(time.Minute).Run()
|
||||||
tst.AssertNoErr(t, err)
|
tst.AssertNoErr(t, err)
|
||||||
|
|
||||||
s1, cs1, _, err := _generateEnumSpecs(tmpDir, "", "N/A", true)
|
s1, cs1, _, err := _generateEnumSpecs(tmpDir, "", "N/A", true, true)
|
||||||
tst.AssertNoErr(t, err)
|
tst.AssertNoErr(t, err)
|
||||||
|
|
||||||
s2, cs2, _, err := _generateEnumSpecs(tmpDir, "", "N/A", true)
|
s2, cs2, _, err := _generateEnumSpecs(tmpDir, "", "N/A", true, true)
|
||||||
tst.AssertNoErr(t, err)
|
tst.AssertNoErr(t, err)
|
||||||
|
|
||||||
tst.AssertEqual(t, cs1, cs2)
|
tst.AssertEqual(t, cs1, cs2)
|
||||||
@ -76,7 +76,7 @@ func TestGenerateEnumSpecsData(t *testing.T) {
|
|||||||
_, err = cmdext.Runner("tar").Arg("-xvzf").Arg(tmpFile).Arg("-C").Arg(tmpDir).FailOnExitCode().FailOnTimeout().Timeout(time.Minute).Run()
|
_, err = cmdext.Runner("tar").Arg("-xvzf").Arg(tmpFile).Arg("-C").Arg(tmpDir).FailOnExitCode().FailOnTimeout().Timeout(time.Minute).Run()
|
||||||
tst.AssertNoErr(t, err)
|
tst.AssertNoErr(t, err)
|
||||||
|
|
||||||
s1, _, _, err := _generateEnumSpecs(tmpDir, "", "", true)
|
s1, _, _, err := _generateEnumSpecs(tmpDir, "", "", true, true)
|
||||||
tst.AssertNoErr(t, err)
|
tst.AssertNoErr(t, err)
|
||||||
|
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
@ -25,6 +25,10 @@ type IDDef struct {
|
|||||||
Name string
|
Name string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type IDGenOptions struct {
|
||||||
|
DebugOutput *bool
|
||||||
|
}
|
||||||
|
|
||||||
var rexIDPackage = rext.W(regexp.MustCompile(`^package\s+(?P<name>[A-Za-z0-9_]+)\s*$`))
|
var rexIDPackage = rext.W(regexp.MustCompile(`^package\s+(?P<name>[A-Za-z0-9_]+)\s*$`))
|
||||||
|
|
||||||
var rexIDDef = rext.W(regexp.MustCompile(`^\s*type\s+(?P<name>[A-Za-z0-9_]+)\s+string\s*//\s*(@id:type).*$`))
|
var rexIDDef = rext.W(regexp.MustCompile(`^\s*type\s+(?P<name>[A-Za-z0-9_]+)\s+string\s*//\s*(@id:type).*$`))
|
||||||
@ -34,7 +38,9 @@ var rexIDChecksumConst = rext.W(regexp.MustCompile(`const ChecksumIDGenerator =
|
|||||||
//go:embed id-generate.template
|
//go:embed id-generate.template
|
||||||
var templateIDGenerateText string
|
var templateIDGenerateText string
|
||||||
|
|
||||||
func GenerateIDSpecs(sourceDir string, destFile string) error {
|
func GenerateIDSpecs(sourceDir string, destFile string, opt *IDGenOptions) error {
|
||||||
|
|
||||||
|
debugOutput := langext.Coalesce(opt.DebugOutput, false)
|
||||||
|
|
||||||
files, err := os.ReadDir(sourceDir)
|
files, err := os.ReadDir(sourceDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -80,13 +86,18 @@ func GenerateIDSpecs(sourceDir string, destFile string) error {
|
|||||||
pkgname := ""
|
pkgname := ""
|
||||||
|
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
|
if debugOutput {
|
||||||
fmt.Printf("========= %s =========\n\n", f.Name())
|
fmt.Printf("========= %s =========\n\n", f.Name())
|
||||||
fileIDs, pn, err := processIDFile(sourceDir, path.Join(sourceDir, f.Name()))
|
}
|
||||||
|
|
||||||
|
fileIDs, pn, err := processIDFile(sourceDir, path.Join(sourceDir, f.Name()), debugOutput)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if debugOutput {
|
||||||
fmt.Printf("\n")
|
fmt.Printf("\n")
|
||||||
|
}
|
||||||
|
|
||||||
allIDs = append(allIDs, fileIDs...)
|
allIDs = append(allIDs, fileIDs...)
|
||||||
|
|
||||||
@ -112,7 +123,7 @@ func GenerateIDSpecs(sourceDir string, destFile string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func processIDFile(basedir string, fn string) ([]IDDef, string, error) {
|
func processIDFile(basedir string, fn string, debugOutput bool) ([]IDDef, string, error) {
|
||||||
file, err := os.Open(fn)
|
file, err := os.Open(fn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
@ -153,7 +164,11 @@ func processIDFile(basedir string, fn string) ([]IDDef, string, error) {
|
|||||||
FileRelative: rfp,
|
FileRelative: rfp,
|
||||||
Name: match.GroupByName("name").Value(),
|
Name: match.GroupByName("name").Value(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if debugOutput {
|
||||||
fmt.Printf("Found ID definition { '%s' }\n", def.Name)
|
fmt.Printf("Found ID definition { '%s' }\n", def.Name)
|
||||||
|
}
|
||||||
|
|
||||||
ids = append(ids, def)
|
ids = append(ids, def)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,10 +34,10 @@ func TestGenerateIDSpecs(t *testing.T) {
|
|||||||
_, err = cmdext.Runner("tar").Arg("-xvzf").Arg(tmpFile).Arg("-C").Arg(tmpDir).FailOnExitCode().FailOnTimeout().Timeout(time.Minute).Run()
|
_, err = cmdext.Runner("tar").Arg("-xvzf").Arg(tmpFile).Arg("-C").Arg(tmpDir).FailOnExitCode().FailOnTimeout().Timeout(time.Minute).Run()
|
||||||
tst.AssertNoErr(t, err)
|
tst.AssertNoErr(t, err)
|
||||||
|
|
||||||
err = GenerateIDSpecs(tmpDir, tmpDir+"/id_gen.go")
|
err = GenerateIDSpecs(tmpDir, tmpDir+"/id_gen.go", &IDGenOptions{DebugOutput: langext.PTrue})
|
||||||
tst.AssertNoErr(t, err)
|
tst.AssertNoErr(t, err)
|
||||||
|
|
||||||
err = GenerateIDSpecs(tmpDir, tmpDir+"/id_gen.go")
|
err = GenerateIDSpecs(tmpDir, tmpDir+"/id_gen.go", &IDGenOptions{DebugOutput: langext.PTrue})
|
||||||
tst.AssertNoErr(t, err)
|
tst.AssertNoErr(t, err)
|
||||||
|
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
@ -5,6 +5,8 @@ type Enum interface {
|
|||||||
ValuesAny() []any
|
ValuesAny() []any
|
||||||
ValuesMeta() []EnumMetaValue
|
ValuesMeta() []EnumMetaValue
|
||||||
VarName() string
|
VarName() string
|
||||||
|
TypeName() string
|
||||||
|
PackageName() string
|
||||||
}
|
}
|
||||||
|
|
||||||
type StringEnum interface {
|
type StringEnum interface {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package goext
|
package goext
|
||||||
|
|
||||||
const GoextVersion = "0.0.401"
|
const GoextVersion = "0.0.402"
|
||||||
|
|
||||||
const GoextVersionTimestamp = "2024-03-09T15:07:03+0100"
|
const GoextVersionTimestamp = "2024-03-10T12:49:31+0100"
|
||||||
|
Loading…
Reference in New Issue
Block a user