github.com/jxskiss/gopkg@v0.17.3/ptr/primitive.go (about) 1 package ptr 2 3 import "time" 4 5 func Bool(v bool) *bool { 6 return &v 7 } 8 9 func String(v string) *string { 10 return &v 11 } 12 13 func Int(v int) *int { 14 return &v 15 } 16 17 func Int8(v int8) *int8 { 18 return &v 19 } 20 21 func Int16(v int16) *int16 { 22 return &v 23 } 24 25 func Int32(v int32) *int32 { 26 return &v 27 } 28 29 func Int64(v int64) *int64 { 30 return &v 31 } 32 33 func Uint(v uint) *uint { 34 return &v 35 } 36 37 func Uint8(v uint8) *uint8 { 38 return &v 39 } 40 41 func Uint16(v uint16) *uint16 { 42 return &v 43 } 44 45 func Uint32(v uint32) *uint32 { 46 return &v 47 } 48 49 func Uint64(v uint64) *uint64 { 50 return &v 51 } 52 53 func Float32(v float32) *float32 { 54 return &v 55 } 56 57 func Float64(v float64) *float64 { 58 return &v 59 } 60 61 func Time(v time.Time) *time.Time { 62 return &v 63 } 64 65 func Duration(v time.Duration) *time.Duration { 66 return &v 67 }