From 7f2cf2805309957a15bb85ff00419b412b21ef32 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Wed, 11 Sep 2024 11:26:58 +0200 Subject: [PATCH] Moved NewVariable to top Moved NewVariable above the receiver methods --- niljson.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/niljson.go b/niljson.go index c7492df..96ca14e 100644 --- a/niljson.go +++ b/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