-
Notifications
You must be signed in to change notification settings - Fork 4
Basic Type
GoblinBear edited this page Apr 10, 2019
·
5 revisions
nil-
UInt8/Int8 -
UInt16/Int16 -
UInt32/Int32 -
UInt64/Int64 Float32Float64BoolStringSliceMap
// boolean
types.NewBool(true)
types.NewBool(false)
// unsigned integer
types.NewUInt8(2)
types.NewUInt16(2)
types.NewUInt32(2)
types.NewUInt64(2)
// signed integer
types.NewInt8(-3)
types.NewInt16(-3)
types.NewInt32(-3)
types.NewInt64(-3)
// float
types.NewFloat32(0.456)
types.NewFloat64(0.456)
// string
types.NewString("Hello world")
// slice
types.NewSlice([]types.RootType {
types.NewFloat32(0.456),
types.NewInt32(-3),
})
// map
types.NewMap(map[string]types.RootType {
types.NewUInt8(2),
types.NewBool(false),
})Call method Get()
v := types.NewUInt8(2)
data := v.Get()Call method Set()
v := types.NewUInt8(2)
v.Set(3)