git.zd.zone/hrpc/hrpc@v0.0.12/types/basic.go (about)

     1  package types
     2  
     3  // These all functions can be used in the optional types in a protobuf file.
     4  
     5  // String will return the pointer of the string
     6  func String(s string) *string {
     7  	return &s
     8  }
     9  
    10  // Int64 will return the pointer of the int64
    11  func Int64(i int64) *int64 {
    12  	return &i
    13  }
    14  
    15  // Int will return the pointer of the int
    16  func Int(i int) *int {
    17  	return &i
    18  }
    19  
    20  // Float64 will return the pointer of the float64
    21  func Float64(f float64) *float64 {
    22  	return &f
    23  }
    24  
    25  // Float32 will return the pointer of the float32
    26  func Float32(f float32) *float32 {
    27  	return &f
    28  }