v0.0.580 Add IsZero() to generated ID types
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m33s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m33s
This commit is contained in:
parent
073aa84dd4
commit
2a0cf84416
@ -183,6 +183,10 @@ func (id {{.Name}}) CheckString() string {
|
||||
return getCheckString(prefix{{.Name}}, string(id))
|
||||
}
|
||||
|
||||
func (id {{.Name}}) IsZero() bool {
|
||||
return id == ""
|
||||
}
|
||||
|
||||
func (id {{.Name}}) Regex() rext.Regex {
|
||||
return regex{{.Name}}
|
||||
}
|
||||
|
@ -45,6 +45,10 @@ func (i {{.Name}}) AsAnyPtr() *{{$.AnyDef.Name}} {
|
||||
}
|
||||
{{end}}
|
||||
|
||||
func (i {{.Name}}) IsZero() bool {
|
||||
return i == ""
|
||||
}
|
||||
|
||||
func New{{.Name}}() {{.Name}} {
|
||||
return {{.Name}}(primitive.NewObjectID().Hex())
|
||||
}
|
||||
|
2
go.mod
2
go.mod
@ -48,7 +48,7 @@ require (
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||
github.com/ugorji/go/codec v1.2.14 // indirect
|
||||
github.com/ugorji/go/codec v1.3.0 // indirect
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
||||
github.com/xdg-go/scram v1.1.2 // indirect
|
||||
github.com/xdg-go/stringprep v1.0.4 // indirect
|
||||
|
2
go.sum
2
go.sum
@ -187,6 +187,8 @@ github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65E
|
||||
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
|
||||
github.com/ugorji/go/codec v1.2.14 h1:yOQvXCBc3Ij46LRkRoh4Yd5qK6LVOgi0bYOXfb7ifjw=
|
||||
github.com/ugorji/go/codec v1.2.14/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
|
||||
github.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=
|
||||
github.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
||||
github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=
|
||||
|
@ -1,5 +1,5 @@
|
||||
package goext
|
||||
|
||||
const GoextVersion = "0.0.579"
|
||||
const GoextVersion = "0.0.580"
|
||||
|
||||
const GoextVersionTimestamp = "2025-06-13T16:53:24+0200"
|
||||
const GoextVersionTimestamp = "2025-06-16T08:40:07+0200"
|
||||
|
Loading…
x
Reference in New Issue
Block a user