From fedf3d4e7c06906787bbc0f24074d01eec35158d Mon Sep 17 00:00:00 2001 From: Douwe <d.geurtjens@students.uu.nl> Date: Tue, 23 Nov 2021 14:28:10 +0100 Subject: [PATCH] math does not exists in golang --- entity/queryStructValidator.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/entity/queryStructValidator.go b/entity/queryStructValidator.go index e866fb9..2d44ce8 100644 --- a/entity/queryStructValidator.go +++ b/entity/queryStructValidator.go @@ -2,7 +2,6 @@ package entity import ( "errors" - "math" ) const ENTITYSTRING = "entity" @@ -101,8 +100,8 @@ func groupByByValid(groupBy QueryGroupByStruct, typeString string, minID int, ma } func getMinAndMaxEntityID(entities []QueryEntityStruct) (int, int) { - min := math.MaxInt - max := math.MinInt + min := 65535 + max := -65535 for _, e := range entities { if e.ID < min { min = e.ID @@ -116,8 +115,8 @@ func getMinAndMaxEntityID(entities []QueryEntityStruct) (int, int) { } func getMinAndMaxRelationID(relations []QueryRelationStruct) (int, int) { - min := math.MaxInt - max := math.MinInt + min := 65535 + max := -65535 for _, e := range relations { if e.ID < min { min = e.ID @@ -132,8 +131,8 @@ func getMinAndMaxRelationID(relations []QueryRelationStruct) (int, int) { } func getMinAndMaxGroupByID(groupBys []QueryGroupByStruct) (int, int) { - min := math.MaxInt - max := math.MinInt + min := 65535 + max := -65535 for _, e := range groupBys { if e.ID < min { min = e.ID -- GitLab