From a2a697900a067609b8bc4132867301b7b0f401b9 Mon Sep 17 00:00:00 2001 From: Kota Kanbe Date: Fri, 2 Apr 2021 15:33:02 +0900 Subject: [PATCH] refactor: move const to constant pkg (#1205) --- constant/constant.go | 3 +++ scanner/base.go | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/constant/constant.go b/constant/constant.go index 8a55d1c1..d552cb47 100644 --- a/constant/constant.go +++ b/constant/constant.go @@ -55,4 +55,7 @@ const ( // ServerTypePseudo is used for ServerInfo.Type, r.Family ServerTypePseudo = "pseudo" + + // DeepSecurity + DeepSecurity = "deepsecurity" ) diff --git a/scanner/base.go b/scanner/base.go index f2ca134b..95d0e3c6 100644 --- a/scanner/base.go +++ b/scanner/base.go @@ -357,15 +357,13 @@ func (l *base) detectDeepSecurity() (string, error) { return "", xerrors.Errorf("Failed to detect deepsecurity %s", l.ServerInfo.ServerName) } -const deepSecurity string = "deepsecurity" - func (l *base) detectIPS() { ips := map[string]string{} fingerprint, err := l.detectDeepSecurity() if err != nil { return } - ips[deepSecurity] = fingerprint + ips[constant.DeepSecurity] = fingerprint l.ServerInfo.IPSIdentifiers = ips }