# README
ptr
The ptr
package gives you some basic helpers for working with pointers in Go.
The package is simply intended to make it easy to create pointers to things.
E.g. instead of writing:
s := "some string"
b := &s
You'd just write
b := ptr.String("some string")
Usage
ptr.Bool(true) // Returns *bool
ptr.Byte(byte('a')) // Returns *byte
ptr.Float32(123.3) // Returns *float32
ptr.Float64(123.3) // Returns *float64
ptr.Int(123) // Returns *int
ptr.Int8(123) // Returns *int8
ptr.Int16(123) // Returns *int16
ptr.Int32(123) // Returns *int32
ptr.Int64(123) // Returns *int64
ptr.Rune(123) // Returns *rune
ptr.String("string") // Returns *string
ptr.Time(time.Now()) // Returns *time.Time
ptr.Uint(123) // Returns *uint
ptr.Uint8(123) // Returns *uint8
ptr.Uint16(123) // Returns *uint16
ptr.Uint32(123) // Returns *uint32
ptr.Uint64(123) // Returns *uint64
Running the tests
go test -v ./...
License
MIT
# Functions
Bool returns a pointer to a boolean.
Byte returns a pointer to a byte.
Float32 returns a pointer to a float.
Float64 returns a pointer to a float.
Int returns a pointer to an int.
Int16 returns a pointer to an int.
Int32 returns a pointer to an int.
Int64 returns a pointer to an int.
Int8 returns a pointer to an int.
Rune returns a pointer to a rune.
String returns a pointer to a string.
Time returns a pointer to a time.Time object.
Uint returns a pointer to an uint.
Uint16 returns a pointer to an uint.
Uint32 returns a pointer to an uint.
Uint64 returns a pointer to an uint.
Uint8 returns a pointer to an uint.