debian-forge-composer/internal/common/pointers.go
Tomas Hozza 9386a02984 internal/common: add helper functions to get pointer to a basic type value
Add two new helper functions `IntToPtr()` and `BoolToPtr()` to the
`internal/common` package, which can be used to conveniently set
basic type literals in a struct literal, in which pointer to the basic
type is expected.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-07-08 19:37:09 +02:00

9 lines
102 B
Go

package common
func IntToPtr(x int) *int {
return &x
}
func BoolToPtr(x bool) *bool {
return &x
}