/
gvar_is.go
51 lines (41 loc) · 1.16 KB
/
gvar_is.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package gvar
import (
"github.com/gogf/gf/v2/internal/utils"
)
// IsNil checks whether `v` is nil.
func (v *Var) IsNil() bool {
return utils.IsNil(v.Val())
}
// IsEmpty checks whether `v` is empty.
func (v *Var) IsEmpty() bool {
return utils.IsEmpty(v.Val())
}
// IsInt checks whether `v` is type of int.
func (v *Var) IsInt() bool {
return utils.IsInt(v.Val())
}
// IsUint checks whether `v` is type of uint.
func (v *Var) IsUint() bool {
return utils.IsUint(v.Val())
}
// IsFloat checks whether `v` is type of float.
func (v *Var) IsFloat() bool {
return utils.IsFloat(v.Val())
}
// IsSlice checks whether `v` is type of slice.
func (v *Var) IsSlice() bool {
return utils.IsSlice(v.Val())
}
// IsMap checks whether `v` is type of map.
func (v *Var) IsMap() bool {
return utils.IsMap(v.Val())
}
// IsStruct checks whether `v` is type of struct.
func (v *Var) IsStruct() bool {
return utils.IsStruct(v.Val())
}