mirror of
https://github.com/rjNemo/underscore
synced 2026-06-06 02:26:42 +00:00
13 lines
199 B
Go
13 lines
199 B
Go
package underscore
|
|
|
|
// Convert values to pointers
|
|
//
|
|
// Instead of:
|
|
// v = "value"
|
|
// MyPointerVar = &v
|
|
//
|
|
// Use:
|
|
// MyPointerVar = ToPointer("value")
|
|
func ToPointer[T any](in T) *T {
|
|
return &in
|
|
}
|