From 2af7a5e2dca9869e304b84d277e6a05bd0fa4275 Mon Sep 17 00:00:00 2001 From: Chris Grindstaff Date: Fri, 14 Apr 2023 09:46:20 -0400 Subject: [PATCH] refactor: remove unnecessary dependency --- integration/go.mod | 5 ++--- integration/go.sum | 11 ++++------- integration/test/dashboard_json_test.go | 12 +++++++----- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/integration/go.mod b/integration/go.mod index 4ae58dffb..df91a23c9 100644 --- a/integration/go.mod +++ b/integration/go.mod @@ -6,12 +6,11 @@ replace github.com/netapp/harvest/v2 => ../ require ( github.com/docker/docker v23.0.3+incompatible - github.com/julienroland/usg v0.0.0-20160918114137-cb52eabb3d84 github.com/netapp/harvest/v2 v2.0.0-20230404163343-f21b0c1a08ac github.com/rs/zerolog v1.29.0 github.com/stretchr/testify v1.8.2 github.com/tidwall/gjson v1.14.4 - golang.org/x/text v0.8.0 + golang.org/x/text v0.9.0 ) require ( @@ -37,7 +36,7 @@ require ( github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect github.com/shirou/gopsutil/v3 v3.23.3 // indirect github.com/shoenig/go-m1cpu v0.1.5 // indirect - github.com/spf13/cobra v1.6.1 // indirect + github.com/spf13/cobra v1.7.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect diff --git a/integration/go.sum b/integration/go.sum index bb4e09ccf..2d72d302b 100644 --- a/integration/go.sum +++ b/integration/go.sum @@ -30,11 +30,8 @@ github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mO github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= -github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/julienroland/usg v0.0.0-20160918114137-cb52eabb3d84 h1:85dnNFRw7mhd4fujbFQraFc6lgJNbvZ8ZqV7/YTOd6w= -github.com/julienroland/usg v0.0.0-20160918114137-cb52eabb3d84/go.mod h1:JbqaH26To+mLqYBTlZi6/G8W5gtrNxZ46yIbCZ3Yl1s= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= @@ -74,8 +71,8 @@ github.com/shoenig/go-m1cpu v0.1.5 h1:LF57Z/Fpb/WdGLjt2HZilNnmZOxg/q2bSKTQhgbrLr github.com/shoenig/go-m1cpu v0.1.5/go.mod h1:Wwvst4LR89UxjeFtLRMrpgRiyY4xPsejnVZym39dbAQ= github.com/shoenig/test v0.6.3 h1:GVXWJFk9PiOjN0KoJ7VrJGH6uLPnqxR7/fe3HUPfE0c= github.com/shoenig/test v0.6.3/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -134,8 +131,8 @@ golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/integration/test/dashboard_json_test.go b/integration/test/dashboard_json_test.go index 16970195a..a8f6b659d 100644 --- a/integration/test/dashboard_json_test.go +++ b/integration/test/dashboard_json_test.go @@ -3,12 +3,10 @@ package main import ( - //"encoding/json" "fmt" "github.com/Netapp/harvest-automation/test/dashboard" "github.com/Netapp/harvest-automation/test/data" "github.com/Netapp/harvest-automation/test/utils" - "github.com/julienroland/usg" "github.com/rs/zerolog/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" @@ -25,6 +23,10 @@ import ( "time" ) +const ( + cross = "✖" +) + var restDataCollectors = []string{"Rest"} var fileSet []string @@ -195,7 +197,7 @@ func (suite *DashboardJsonTestSuite) TestJsonExpression() { for _, resultInfo := range zapiErrorInfoList { if !resultInfo.result { isZapiFailed = true - fmt.Println(usg.Get.Cross, fmt.Sprintf(" Zapi Collector ERROR: %s for expr [%s]", resultInfo.reason, + fmt.Println(cross, fmt.Sprintf(" Zapi Collector ERROR: %s for expr [%s]", resultInfo.reason, resultInfo.expression)) } } @@ -203,7 +205,7 @@ func (suite *DashboardJsonTestSuite) TestJsonExpression() { for _, resultInfo := range restErrorInfoList { if !resultInfo.result { isRestFailed = true - fmt.Println(usg.Get.Cross, fmt.Sprintf(" Rest Collector ERROR: %s for expr [%s]", resultInfo.reason, + fmt.Println(cross, fmt.Sprintf(" Rest Collector ERROR: %s for expr [%s]", resultInfo.reason, resultInfo.expression)) } } @@ -299,7 +301,7 @@ func GetAllJsons(dir string) []string { } func FindStringBetweenTwoChar(stringValue string, startChar string, endChar string) []string { - var counters []string = make([]string, 0) + var counters = make([]string, 0) var isStringAlphabetic = regexp.MustCompile(`^[a-zA-Z0-9_]*$`).MatchString firstSet := strings.Split(stringValue, startChar) for _, actualString := range firstSet {