Compare commits

...

2 Commits

Author SHA1 Message Date
da52bb5c90 v0.0.264 added Valid() to id-gen
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 49s
2023-09-18 11:46:17 +02:00
3d4afe7b25 v0.0.263 re-add checksum guard to id-generate
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 50s
2023-09-18 10:43:29 +02:00
2 changed files with 10 additions and 3 deletions

View File

@@ -67,7 +67,7 @@ func GenerateIDSpecs(sourceDir string, destFile string) error {
fmt.Printf("[IDGenerate] Checksum has changed ( %s -> %s ), will generate new file\n\n", oldChecksum, newChecksum) fmt.Printf("[IDGenerate] Checksum has changed ( %s -> %s ), will generate new file\n\n", oldChecksum, newChecksum)
} else { } else {
fmt.Printf("[IDGenerate] Checksum unchanged ( %s ), nothing to do\n", oldChecksum) fmt.Printf("[IDGenerate] Checksum unchanged ( %s ), nothing to do\n", oldChecksum)
//TODO return nil return nil
} }
allIDs := make([]IDDef, 0) allIDs := make([]IDDef, 0)
@@ -209,6 +209,13 @@ func fmtIDOutput(cs string, ids []IDDef, pkgname string) string {
str += "" + "\n" str += "" + "\n"
str += "func (i " + iddef.Name + ") Valid() bool {" + "\n"
str += " _, err := primitive.ObjectIDFromHex(string(i))" + "\n"
str += " return err == nil" + "\n"
str += "}" + "\n"
str += "" + "\n"
if anyDef != nil { if anyDef != nil {
str += "func (i " + iddef.Name + ") AsAny() " + anyDef.Name + " {" + "\n" str += "func (i " + iddef.Name + ") AsAny() " + anyDef.Name + " {" + "\n"
str += " return " + anyDef.Name + "(i)" + "\n" str += " return " + anyDef.Name + "(i)" + "\n"

View File

@@ -1,5 +1,5 @@
package goext package goext
const GoextVersion = "0.0.262" const GoextVersion = "0.0.264"
const GoextVersionTimestamp = "2023-09-18T10:42:43+0200" const GoextVersionTimestamp = "2023-09-18T11:46:17+0200"