Commit 4719084
committed
utils: add generic function for pointers
Go doesn't offer a generic method to convert a type in to its pointer.
This method is practical for the podman bindings where there are several
field which are pointer, and without this method, you would need to
define a variable and then pass its address. E.g for booleans:
foo := utils.Ptr(true)
instead of
t := true
foo := &t
Signed-off-by: Alice Frosi <afrosi@redhat.com>1 parent c2e612e commit 4719084
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments