Moving PtrOf to package internal/ptr
This commit is contained in:
parent
99be328e9d
commit
c2703558d7
13 changed files with 148 additions and 136 deletions
|
|
@ -292,11 +292,6 @@ func printDiff(actual, expected interface{}, options ...cmp.Option) {
|
|||
fmt.Println(expected)
|
||||
}
|
||||
|
||||
// PtrOf returns the address of any given parameter
|
||||
func PtrOf[T any](value T) *T {
|
||||
return &value
|
||||
}
|
||||
|
||||
// UUIDPtr returns address of uuid.UUID
|
||||
func UUIDPtr(u string) *uuid.UUID {
|
||||
newUUID := uuid.MustParse(u)
|
||||
|
|
|
|||
6
internal/utils/ptr/ptr.go
Normal file
6
internal/utils/ptr/ptr.go
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
package ptr
|
||||
|
||||
// Of returns the address of any given parameter
|
||||
func Of[T any](value T) *T {
|
||||
return &value
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue