gitlab.com/ignitionrobotics/web/ign-go@v1.0.0-rc4/types.go (about)

     1  package ign
     2  
     3  // Int returns a pointer to the int value passed in.
     4  func Int(v int) *int {
     5  	return &v
     6  }
     7  
     8  // Int64 returns a pointer to the int64 value passed in.
     9  func Int64(v int64) *int64 {
    10  	return &v
    11  }
    12  
    13  // Float64 returns a pointer to the float64 value passed in.
    14  func Float64(v float64) *float64 {
    15  	return &v
    16  }
    17  
    18  // String returns a pointer to the string value passed in.
    19  func String(v string) *string {
    20  	return &v
    21  }
    22  
    23  // StringSlice converts a slice of string values into a slice of
    24  // string pointers
    25  func StringSlice(src []string) []*string {
    26  	dst := make([]*string, len(src))
    27  	for i := 0; i < len(src); i++ {
    28  		dst[i] = &(src[i])
    29  	}
    30  	return dst
    31  }
    32  
    33  // Bool returns a pointer to the bool value passed in.
    34  func Bool(v bool) *bool {
    35  	return &v
    36  }