diff --git a/go.mod b/go.mod index 88d87e1..9e4adfd 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/montanaflynn/stats v0.7.1 // indirect - github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.1.1 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect diff --git a/go.sum b/go.sum index f19ae3a..a77fb9b 100644 --- a/go.sum +++ b/go.sum @@ -88,6 +88,8 @@ github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8 github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= +github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= diff --git a/goextVersion.go b/goextVersion.go index ab1d373..811bfe1 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.345" +const GoextVersion = "0.0.346" -const GoextVersionTimestamp = "2023-12-07T19:39:31+0100" +const GoextVersionTimestamp = "2023-12-13T16:22:15+0100" diff --git a/langext/pointer.go b/langext/pointer.go index ac09045..a57a587 100644 --- a/langext/pointer.go +++ b/langext/pointer.go @@ -10,10 +10,23 @@ var PTrue = Ptr(true) // PFalse := &false var PFalse = Ptr(false) +// PNil := &nil +var PNil = Ptr[any](nil) + func Ptr[T any](v T) *T { return &v } +func DblPtr[T any](v T) **T { + v_ := &v + return &v_ +} + +func DblPtrNil[T any]() **T { + var v *T = nil + return &v +} + func PtrInt32(v int32) *int32 { return &v }