debian-forge-composer/internal/common/pointers.go
Tomas Hozza 6c32ff048a internal/common: add function to get a pointer to string literal
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>
2021-08-02 19:05:09 +02:00

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
}