mirror of
https://github.com/wneessen/niljson.git
synced 2024-11-21 21:20:50 +01:00
Moved NewVariable to top
Moved NewVariable above the receiver methods
This commit is contained in:
parent
270111e53f
commit
7f2cf28053
1 changed files with 5 additions and 5 deletions
10
niljson.go
10
niljson.go
|
@ -51,11 +51,6 @@ type Variable[T any] struct {
|
|||
present bool
|
||||
}
|
||||
|
||||
// IsNil returns true when a Variable is nil
|
||||
func (v *Variable[T]) IsNil() bool {
|
||||
return !v.notNil
|
||||
}
|
||||
|
||||
// NewVariable returns a new Variable of generic type
|
||||
func NewVariable[T any](value T) Variable[T] {
|
||||
return Variable[T]{
|
||||
|
@ -64,6 +59,11 @@ func NewVariable[T any](value T) Variable[T] {
|
|||
}
|
||||
}
|
||||
|
||||
// IsNil returns true when a Variable is nil
|
||||
func (v *Variable[T]) IsNil() bool {
|
||||
return !v.notNil
|
||||
}
|
||||
|
||||
// NotNil returns true when a Variable is not nil
|
||||
func (v *Variable[T]) NotNil() bool {
|
||||
return v.notNil
|
||||
|
|
Loading…
Reference in a new issue