v0.0.264 added Valid() to id-gen
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 49s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 49s
This commit is contained in:
@@ -209,6 +209,13 @@ func fmtIDOutput(cs string, ids []IDDef, pkgname string) string {
|
||||
|
||||
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 {
|
||||
str += "func (i " + iddef.Name + ") AsAny() " + anyDef.Name + " {" + "\n"
|
||||
str += " return " + anyDef.Name + "(i)" + "\n"
|
||||
|
Reference in New Issue
Block a user