Documentation ¶
Index ¶
- Variables
- type Float32
- type Float64
- type Int
- func (v *Int) Add(value int)
- func (v *Int) Dec()
- func (v *Int) Div(value int)
- func (v *Int) DivisibleBy(value int) bool
- func (v *Int) Equal(value int) bool
- func (v *Int) Even() bool
- func (v *Int) GreaterThan(value int) bool
- func (v *Int) GreaterThanOrEqual(value int) bool
- func (v *Int) Inc()
- func (v *Int) LessThan(value int) bool
- func (v *Int) LessThanOrEqual(value int) bool
- func (v *Int) Mod(value int)
- func (v *Int) Mul(value int)
- func (v *Int) Negative() bool
- func (v *Int) NotEqual(value int) bool
- func (v *Int) Odd() bool
- func (v *Int) Positive() bool
- func (v *Int) Prime() bool
- func (v *Int) Sub(value int)
- func (v *Int) Zero() bool
- type Int16
- func (v *Int16) Add(value int16)
- func (v *Int16) Dec()
- func (v *Int16) Div(value int16)
- func (v *Int16) DivisibleBy(value int16) bool
- func (v *Int16) Equal(value int16) bool
- func (v *Int16) Even() bool
- func (v *Int16) GreaterThan(value int16) bool
- func (v *Int16) GreaterThanOrEqual(value int16) bool
- func (v *Int16) Inc()
- func (v *Int16) LessThan(value int16) bool
- func (v *Int16) LessThanOrEqual(value int16) bool
- func (v *Int16) Mod(value int16)
- func (v *Int16) Mul(value int16)
- func (v *Int16) Negative() bool
- func (v *Int16) NotEqual(value int16) bool
- func (v *Int16) Odd() bool
- func (v *Int16) Positive() bool
- func (v *Int16) Prime() bool
- func (v *Int16) Sub(value int16)
- func (v *Int16) Zero() bool
- type Int32
- func (v *Int32) Add(value int32)
- func (v *Int32) Dec()
- func (v *Int32) Div(value int32)
- func (v *Int32) DivisibleBy(value int32) bool
- func (v *Int32) Equal(value int32) bool
- func (v *Int32) Even() bool
- func (v *Int32) GreaterThan(value int32) bool
- func (v *Int32) GreaterThanOrEqual(value int32) bool
- func (v *Int32) Inc()
- func (v *Int32) LessThan(value int32) bool
- func (v *Int32) LessThanOrEqual(value int32) bool
- func (v *Int32) Mod(value int32)
- func (v *Int32) Mul(value int32)
- func (v *Int32) Negative() bool
- func (v *Int32) NotEqual(value int32) bool
- func (v *Int32) Odd() bool
- func (v *Int32) Positive() bool
- func (v *Int32) Prime() bool
- func (v *Int32) Sub(value int32)
- func (v *Int32) Zero() bool
- type Int64
- func (v *Int64) Add(value int64)
- func (v *Int64) Dec()
- func (v *Int64) Div(value int64)
- func (v *Int64) DivisibleBy(value int64) bool
- func (v *Int64) Equal(value int64) bool
- func (v *Int64) Even() bool
- func (v *Int64) GreaterThan(value int64) bool
- func (v *Int64) GreaterThanOrEqual(value int64) bool
- func (v *Int64) Inc()
- func (v *Int64) LessThan(value int64) bool
- func (v *Int64) LessThanOrEqual(value int64) bool
- func (v *Int64) Mod(value int64)
- func (v *Int64) Mul(value int64)
- func (v *Int64) Negative() bool
- func (v *Int64) NotEqual(value int64) bool
- func (v *Int64) Odd() bool
- func (v *Int64) Positive() bool
- func (v *Int64) Prime() bool
- func (v *Int64) Sub(value int64)
- func (v *Int64) Zero() bool
- type Int8
- func (v *Int8) Add(value int8)
- func (v *Int8) Dec()
- func (v *Int8) Div(value int8)
- func (v *Int8) DivisibleBy(value int8) bool
- func (v *Int8) Equal(value int8) bool
- func (v *Int8) Even() bool
- func (v *Int8) GreaterThan(value int8) bool
- func (v *Int8) GreaterThanOrEqual(value int8) bool
- func (v *Int8) Inc()
- func (v *Int8) LessThan(value int8) bool
- func (v *Int8) LessThanOrEqual(value int8) bool
- func (v *Int8) Mod(value int8)
- func (v *Int8) Mul(value int8)
- func (v *Int8) Negative() bool
- func (v *Int8) NotEqual(value int8) bool
- func (v *Int8) Odd() bool
- func (v *Int8) Positive() bool
- func (v *Int8) Prime() bool
- func (v *Int8) Sub(value int8)
- func (v *Int8) Zero() bool
- type String
- type Type
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ( JSONMarshal = json.Marshal JSONUnmarshal = json.Unmarshal )
Functions ¶
This section is empty.
Types ¶
type Float32 ¶ added in v0.2.0
Float32 is a wrapper for float32 type.
func NewFloat32 ¶ added in v0.2.0
NewFloat32 creates a new Float32.
func (*Float32) Inc ¶ added in v0.2.0
func (v *Float32) Inc()
Inc calculates the remainder of Float32 divided by value.
type Float64 ¶ added in v0.2.0
func NewFloat64 ¶ added in v0.2.0
func (*Float64) Inc ¶ added in v0.2.0
func (v *Float64) Inc()
Inc calculates the remainder of Float32 divided by value.
type Int ¶ added in v0.2.0
Int is a wrapper for int type.
func (*Int) DivisibleBy ¶ added in v0.2.0
DivisibleBy returns true if Int is divisible by value.
func (*Int) GreaterThan ¶ added in v0.2.0
GreaterThan returns true if Int is greater than value.
func (*Int) GreaterThanOrEqual ¶ added in v0.2.0
GreaterThanOrEqual returns true if Int is greater than or equal to value.
func (*Int) LessThanOrEqual ¶ added in v0.2.0
LessThanOrEqual returns true if Int is less than or equal to value.
type Int16 ¶ added in v0.2.0
Int16 is a wrapper for int type.
func (*Int16) DivisibleBy ¶ added in v0.2.0
DivisibleBy returns true if Int16 is divisible by value.
func (*Int16) GreaterThan ¶ added in v0.2.0
GreaterThan returns true if Int16 is greater than value.
func (*Int16) GreaterThanOrEqual ¶ added in v0.2.0
GreaterThanOrEqual returns true if Int16 is greater than or equal to value.
func (*Int16) LessThanOrEqual ¶ added in v0.2.0
LessThanOrEqual returns true if Int16 is less than or equal to value.
type Int32 ¶ added in v0.2.0
Int32 is a wrapper for int type.
func (*Int32) DivisibleBy ¶ added in v0.2.0
DivisibleBy returns true if Int32 is divisible by value.
func (*Int32) GreaterThan ¶ added in v0.2.0
GreaterThan returns true if Int32 is greater than value.
func (*Int32) GreaterThanOrEqual ¶ added in v0.2.0
GreaterThanOrEqual returns true if Int32 is greater than or equal to value.
func (*Int32) LessThanOrEqual ¶ added in v0.2.0
LessThanOrEqual returns true if Int32 is less than or equal to value.
type Int64 ¶ added in v0.2.0
Int64 is a wrapper for int type.
func (*Int64) DivisibleBy ¶ added in v0.2.0
DivisibleBy returns true if Int64 is divisible by value.
func (*Int64) GreaterThan ¶ added in v0.2.0
GreaterThan returns true if Int64 is greater than value.
func (*Int64) GreaterThanOrEqual ¶ added in v0.2.0
GreaterThanOrEqual returns true if Int64 is greater than or equal to value.
func (*Int64) LessThanOrEqual ¶ added in v0.2.0
LessThanOrEqual returns true if Int64 is less than or equal to value.
type Int8 ¶ added in v0.2.0
Int8 is a wrapper for int type.
func (*Int8) DivisibleBy ¶ added in v0.2.0
DivisibleBy returns true if Int8 is divisible by value.
func (*Int8) GreaterThan ¶ added in v0.2.0
GreaterThan returns true if Int8 is greater than value.
func (*Int8) GreaterThanOrEqual ¶ added in v0.2.0
GreaterThanOrEqual returns true if Int8 is greater than or equal to value.
func (*Int8) LessThanOrEqual ¶ added in v0.2.0
LessThanOrEqual returns true if Int8 is less than or equal to value.
type Type ¶
Example ¶
package main import ( "encoding/json" "fmt" "log" "github.com/RekeningkuDev/nill" ) func main() { type BarTest struct { Text nill.Type[string] `json:"text"` } type FooTest struct { Bar nill.Type[BarTest] `json:"bar"` } foo := FooTest{ Bar: nill.Type[BarTest]{ Valid: true, V: BarTest{ Text: nill.Type[string]{ Valid: true, V: "test", }, }, }, } jsonStr, err := json.Marshal(foo) if err != nil { log.Fatal(err) } fmt.Println(string(jsonStr)) }
Output: {"bar":{"text":"test"}}
func (Type[T]) MarshalJSON ¶
func (*Type[T]) Scan ¶ added in v1.1.0
Scan implements the sql.Scanner interface.