Add a new helper function to get a pointer to a string literal. Add unit test for the new function. Signed-off-by: Tomas Hozza <thozza@redhat.com>
17 lines
204 B
Go
17 lines
204 B
Go
package common
|
|
|
|
func IntToPtr(x int) *int {
|
|
return &x
|
|
}
|
|
|
|
func Uint64ToPtr(x uint64) *uint64 {
|
|
return &x
|
|
}
|
|
|
|
func BoolToPtr(x bool) *bool {
|
|
return &x
|
|
}
|
|
|
|
func StringToPtr(x string) *string {
|
|
return &x
|
|
}
|