-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathnull.go
27 lines (21 loc) · 910 Bytes
/
null.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package gates
type _Null struct{}
var Null _Null
func (_Null) IsString() bool { return false }
func (_Null) IsInt() bool { return false }
func (_Null) IsFloat() bool { return false }
func (_Null) IsBool() bool { return false }
func (_Null) IsFunction() bool { return false }
func (_Null) ToString() string { return "" }
func (_Null) ToInt() int64 { return 0 }
func (_Null) ToFloat() float64 { return 0 }
func (_Null) ToNumber() Number { return Int(0) }
func (_Null) ToBool() bool { return false }
func (_Null) ToFunction() Function { return _EmptyFunction }
func (_Null) ToNative(...ToNativeOption) interface{} { return nil }
func (_Null) Equals(other Value) bool {
return other == Null
}
func (_Null) SameAs(other Value) bool {
return other == Null
}