Operators matrices

Operator → go type matrix

Operator vs go type nil bool string {u,}int* float* complex* array slice map struct pointer interface¹ chan func operator
All All
Any Any
Array ptr on array Array
ArrayEach ptr on array/slice ArrayEach
Bag ptr on array/slice Bag
Between todo time.Time Between
Cap Cap
Catch Catch
Code Code
Contains ✓ + fmt.Stringer/error Contains
Operator vs go type nil bool string {u,}int* float* complex* array slice map struct pointer interface¹ chan func operator
ContainsKey ContainsKey
Delay Delay
Empty ptr on array/slice/map/string Empty
Gt todo time.Time Gt
Gte todo time.Time Gte
HasPrefix []byte ✓ + fmt.Stringer/error HasPrefix
HasSuffix []byte ✓ + fmt.Stringer/error HasSuffix
Ignore Ignore
Isa Isa
JSON JSON
Operator vs go type nil bool string {u,}int* float* complex* array slice map struct pointer interface¹ chan func operator
Keys Keys
Lax Lax
Len Len
Lt todo time.Time Lt
Lte todo time.Time Lte
Map ptr on map Map
MapEach ptr on map MapEach
N todo N
NaN NaN
Nil Nil
Operator vs go type nil bool string {u,}int* float* complex* array slice map struct pointer interface¹ chan func operator
None None
Not Not
NotAny ptr on array/slice NotAny
NotEmpty ptr on array/slice/map/string NotEmpty
NotNaN NotNaN
NotNil NotNil
NotZero NotZero
PPtr PPtr
Ptr Ptr
Re []byte ✓ + fmt.Stringer/error Re
Operator vs go type nil bool string {u,}int* float* complex* array slice map struct pointer interface¹ chan func operator
ReAll []byte ✓ + fmt.Stringer/error ReAll
Set ptr on array/slice Set
Shallow Shallow
Slice ptr on slice Slice
Smuggle Smuggle
SStruct ptr on struct SStruct
String []byte ✓ + fmt.Stringer/error String
Struct ptr on struct Struct
SubBagOf ptr on array/slice SubBagOf
SubJSONOf ptr on map/struct SubJSONOf
Operator vs go type nil bool string {u,}int* float* complex* array slice map struct pointer interface¹ chan func operator
SubMapOf ptr on map SubMapOf
SubSetOf ptr on array/slice SubSetOf
SuperBagOf ptr on array/slice SuperBagOf
SuperJSONOf ptr on map/struct SuperJSONOf
SuperMapOf ptr on map SuperMapOf
SuperSetOf ptr on array/slice SuperSetOf
Tag Tag
TruncTime time.Time todo TruncTime
Values Values
Zero Zero

Legend:

  • ✗ means using this operator with a value type of this kind will always fail
  • ✓ means using this operator with a value type of this kind can succeed
  • []byte, time.Time, ptr on X, fmt.Stringer, error means using this operator with this go type can succeed
  • todo means should be implemented in future (PRs welcome :) )
  • ¹ + ✓ means using this operator with the data behind the interface can succeed

go type → operator matrix

Operators likely to succeed for each go type:

Untyped nil value

bool values (or any type based on bool)

string values (or any type based on string)

Integer values (uint*, int* or any type based on them)

Float values (float32, float64 or any type based on them)

Complex values (complex64, complex128 or any type based on them)

Arrays

Slices

Maps

Structs

Interface values

As all operators accept interface values, only specific interfaces are listed below:

Any pointer

Channels

Functions