gitlab.com/evatix-go/core@v1.3.55/converters/coreconverted/Integers.go (about) 1 package coreconverted 2 3 type Integers struct { 4 Values []int 5 CombinedError error 6 } 7 8 func (it *Integers) HasError() bool { 9 return it.CombinedError != nil 10 } 11 12 func (it *Integers) Length() int { 13 if it == nil || it.Values == nil { 14 return 0 15 } 16 17 return len(it.Values) 18 } 19 20 func (it *Integers) IsEmpty() bool { 21 return it.Length() == 0 22 } 23 24 func (it *Integers) HasAnyItem() bool { 25 return it.Length() > 0 26 } 27 28 func (it *Integers) HasIssuesOrEmpty() bool { 29 return it.IsEmpty() || it.CombinedError != nil 30 } 31 32 func (it *Integers) HandleWithPanic() { 33 if it.CombinedError == nil { 34 return 35 } 36 37 panic(it.CombinedError) 38 }