Files
nomad/api/utils.go
Mahmood Ali 41c3250ee5 api: embed pointer conversion functions
Embed pointer conversion functions in the API package to avoid
unnecessary package dependency.  `helper` package imports more
dependencies relevant for internal use (e.g. `hcl`).
2019-01-18 15:31:04 -05:00

29 lines
515 B
Go

package api
import "time"
// boolToPtr returns the pointer to a boolean
func boolToPtr(b bool) *bool {
return &b
}
// intToPtr returns the pointer to an int
func intToPtr(i int) *int {
return &i
}
// uint64ToPtr returns the pointer to an uint64
func uint64ToPtr(u uint64) *uint64 {
return &u
}
// stringToPtr returns the pointer to a string
func stringToPtr(str string) *string {
return &str
}
// timeToPtr returns the pointer to a time stamp
func timeToPtr(t time.Duration) *time.Duration {
return &t
}