From d38fd0e480cd0be80dd237598e95cbe3cf01c206 Mon Sep 17 00:00:00 2001 From: Jozef Reisinger Date: Thu, 6 Jun 2024 13:32:28 +0200 Subject: [PATCH] use iota the proper way --- checkip.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/checkip.go b/checkip.go index 60ea55d..41e95cd 100644 --- a/checkip.go +++ b/checkip.go @@ -13,20 +13,11 @@ const ( ) // Type is the type of a Check. -type Type int32 +type Type int -// String returns the name of the Check type: Info, Sec or InfoSec. +// String returns the name of the Check type. func (t Type) String() string { - switch t { - case TypeInfo: - return "Info" - case TypeSec: - return "Sec" - case TypeInfoSec: - return "InfoSec" - default: - return "Unknown check type" - } + return [...]string{"Info", "Sec", "InfoSec"}[t] } // Check provides generic and/or security information about an IP address.