github.com/dashpay/godash@v0.0.0-20160726055534-e038a21e0e3d/btcjson/helpers.go (about)

     1  // Copyright (c) 2014 The btcsuite developers
     2  // Copyright (c) 2016 The Dash developers
     3  // Use of this source code is governed by an ISC
     4  // license that can be found in the LICENSE file.
     5  
     6  package btcjson
     7  
     8  // Bool is a helper routine that allocates a new bool value to store v and
     9  // returns a pointer to it.  This is useful when assigning optional parameters.
    10  func Bool(v bool) *bool {
    11  	p := new(bool)
    12  	*p = v
    13  	return p
    14  }
    15  
    16  // Int is a helper routine that allocates a new int value to store v and
    17  // returns a pointer to it.  This is useful when assigning optional parameters.
    18  func Int(v int) *int {
    19  	p := new(int)
    20  	*p = v
    21  	return p
    22  }
    23  
    24  // Uint is a helper routine that allocates a new uint value to store v and
    25  // returns a pointer to it.  This is useful when assigning optional parameters.
    26  func Uint(v uint) *uint {
    27  	p := new(uint)
    28  	*p = v
    29  	return p
    30  }
    31  
    32  // Int32 is a helper routine that allocates a new int32 value to store v and
    33  // returns a pointer to it.  This is useful when assigning optional parameters.
    34  func Int32(v int32) *int32 {
    35  	p := new(int32)
    36  	*p = v
    37  	return p
    38  }
    39  
    40  // Uint32 is a helper routine that allocates a new uint32 value to store v and
    41  // returns a pointer to it.  This is useful when assigning optional parameters.
    42  func Uint32(v uint32) *uint32 {
    43  	p := new(uint32)
    44  	*p = v
    45  	return p
    46  }
    47  
    48  // Int64 is a helper routine that allocates a new int64 value to store v and
    49  // returns a pointer to it.  This is useful when assigning optional parameters.
    50  func Int64(v int64) *int64 {
    51  	p := new(int64)
    52  	*p = v
    53  	return p
    54  }
    55  
    56  // Uint64 is a helper routine that allocates a new uint64 value to store v and
    57  // returns a pointer to it.  This is useful when assigning optional parameters.
    58  func Uint64(v uint64) *uint64 {
    59  	p := new(uint64)
    60  	*p = v
    61  	return p
    62  }
    63  
    64  // Float64 is a helper routine that allocates a new float64 value to store v and
    65  // returns a pointer to it.  This is useful when assigning optional parameters.
    66  func Float64(v float64) *float64 {
    67  	p := new(float64)
    68  	*p = v
    69  	return p
    70  }
    71  
    72  // String is a helper routine that allocates a new string value to store v and
    73  // returns a pointer to it.  This is useful when assigning optional parameters.
    74  func String(v string) *string {
    75  	p := new(string)
    76  	*p = v
    77  	return p
    78  }