diff --git a/e2h_example_test.go b/e2h_example_test.go index 9984297..e7b2163 100644 --- a/e2h_example_test.go +++ b/e2h_example_test.go @@ -9,6 +9,7 @@ import ( "path/filepath" "runtime" + "github.com/cdleo/go-commons/formatter" "github.com/cdleo/go-e2h" e2hformat "github.com/cdleo/go-e2h/formatter" ) @@ -39,7 +40,7 @@ func ExampleEnhancedError() { params := e2hformat.Params{ Beautify: false, InvertCallstack: true, - PathHidingMethod: e2hformat.HidingMethod_FullBaseline, + PathHidingMethod: formatter.HidingMethod_FullBaseline, PathHidingValue: hideThisPath, } @@ -79,14 +80,14 @@ func ExampleEnhancedError() { // Just cause => TheError // // Full info (inverted stack) => - // github.com/cdleo/go-e2h_test.ExampleEnhancedError (e2h_example_test.go:46) [Error executing [bar()] function]; github.com/cdleo/go-e2h_test.bar (e2h_example_test.go:32) [Error executing foo()]; github.com/cdleo/go-e2h_test.foo (e2h_example_test.go:23); TheError; + // github.com/cdleo/go-e2h_test.ExampleEnhancedError (e2h_example_test.go:47) [Error executing [bar()] function]; github.com/cdleo/go-e2h_test.bar (e2h_example_test.go:33) [Error executing foo()]; github.com/cdleo/go-e2h_test.foo (e2h_example_test.go:24); TheError; // // Full info (beautified / inverted stack) => - // github.com/cdleo/go-e2h_test.ExampleEnhancedError (e2h_example_test.go:46) + // github.com/cdleo/go-e2h_test.ExampleEnhancedError (e2h_example_test.go:47) // Error executing [bar()] function - // github.com/cdleo/go-e2h_test.bar (e2h_example_test.go:32) + // github.com/cdleo/go-e2h_test.bar (e2h_example_test.go:33) // Error executing foo() - // github.com/cdleo/go-e2h_test.foo (e2h_example_test.go:23) + // github.com/cdleo/go-e2h_test.foo (e2h_example_test.go:24) // TheError // // **** JSON Formatter **** @@ -94,7 +95,7 @@ func ExampleEnhancedError() { // Just cause => {"error":"TheError"} // // Full info => - // {"error":"TheError","stack_trace":[{"func":"github.com/cdleo/go-e2h_test.foo","caller":"e2h_example_test.go:23"},{"func":"github.com/cdleo/go-e2h_test.bar","caller":"e2h_example_test.go:32","context":"Error executing foo()"},{"func":"github.com/cdleo/go-e2h_test.ExampleEnhancedError","caller":"e2h_example_test.go:46","context":"Error executing [bar()] function"}]} + // {"error":"TheError","stack_trace":[{"func":"github.com/cdleo/go-e2h_test.foo","caller":"e2h_example_test.go:24"},{"func":"github.com/cdleo/go-e2h_test.bar","caller":"e2h_example_test.go:33","context":"Error executing foo()"},{"func":"github.com/cdleo/go-e2h_test.ExampleEnhancedError","caller":"e2h_example_test.go:47","context":"Error executing [bar()] function"}]} // // Full info (beautified) => // { @@ -102,16 +103,16 @@ func ExampleEnhancedError() { // "stack_trace": [ // { // "func": "github.com/cdleo/go-e2h_test.foo", - // "caller": "e2h_example_test.go:23" + // "caller": "e2h_example_test.go:24" // }, // { // "func": "github.com/cdleo/go-e2h_test.bar", - // "caller": "e2h_example_test.go:32", + // "caller": "e2h_example_test.go:33", // "context": "Error executing foo()" // }, // { // "func": "github.com/cdleo/go-e2h_test.ExampleEnhancedError", - // "caller": "e2h_example_test.go:46", + // "caller": "e2h_example_test.go:47", // "context": "Error executing [bar()] function" // } // ] diff --git a/e2h_test.go b/e2h_test.go index 23a25c3..adc230c 100644 --- a/e2h_test.go +++ b/e2h_test.go @@ -11,6 +11,7 @@ import ( "strings" "testing" + "github.com/cdleo/go-commons/formatter" "github.com/cdleo/go-e2h" e2hformat "github.com/cdleo/go-e2h/formatter" "github.com/stretchr/testify/require" @@ -106,7 +107,7 @@ func TestEnhancedError_EnhErr_RawFormatter_Format(t *testing.T) { _, b, _, _ := runtime.Caller(0) hideThisPath := filepath.Dir(b) + string(os.PathSeparator) params := e2hformat.Params{ - PathHidingMethod: e2hformat.HidingMethod_FullBaseline, + PathHidingMethod: formatter.HidingMethod_FullBaseline, PathHidingValue: hideThisPath, } @@ -114,7 +115,7 @@ func TestEnhancedError_EnhErr_RawFormatter_Format(t *testing.T) { output := rawFormatter.Format(enhancedErr, params) // Check - require.Equal(t, output, "This is a standard error; github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_RawFormatter_Format (e2h_test.go:104) [Error wrapped with additional info];") + require.Equal(t, output, "This is a standard error; github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_RawFormatter_Format (e2h_test.go:105) [Error wrapped with additional info];") } func TestEnhancedError_EnhErr_JSONFormatter_Format(t *testing.T) { @@ -125,7 +126,7 @@ func TestEnhancedError_EnhErr_JSONFormatter_Format(t *testing.T) { _, b, _, _ := runtime.Caller(0) hideThisPath := filepath.Dir(b) + string(os.PathSeparator) params := e2hformat.Params{ - PathHidingMethod: e2hformat.HidingMethod_FullBaseline, + PathHidingMethod: formatter.HidingMethod_FullBaseline, PathHidingValue: hideThisPath, } @@ -133,7 +134,7 @@ func TestEnhancedError_EnhErr_JSONFormatter_Format(t *testing.T) { output := jsonFormatter.Format(enhancedErr, params) // Check - require.Equal(t, output, "{\"error\":\"This is a standard error\",\"stack_trace\":[{\"func\":\"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_JSONFormatter_Format\",\"caller\":\"e2h_test.go:123\",\"context\":\"Error wrapped with additional info\"}]}") + require.Equal(t, output, "{\"error\":\"This is a standard error\",\"stack_trace\":[{\"func\":\"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_JSONFormatter_Format\",\"caller\":\"e2h_test.go:124\",\"context\":\"Error wrapped with additional info\"}]}") } func TestEnhancedError_EnhErr_RawFormatter_Format_Beautified(t *testing.T) { @@ -144,7 +145,7 @@ func TestEnhancedError_EnhErr_RawFormatter_Format_Beautified(t *testing.T) { _, b, _, _ := runtime.Caller(0) hideThisPath := filepath.Dir(b) + string(os.PathSeparator) params := e2hformat.Params{ - PathHidingMethod: e2hformat.HidingMethod_FullBaseline, + PathHidingMethod: formatter.HidingMethod_FullBaseline, PathHidingValue: hideThisPath, Beautify: true, } @@ -153,7 +154,7 @@ func TestEnhancedError_EnhErr_RawFormatter_Format_Beautified(t *testing.T) { output := rawFormatter.Format(enhancedErr, params) // Check - require.Equal(t, output, "This is a standard error\ngithub.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_RawFormatter_Format_Beautified (e2h_test.go:142)\n\tError wrapped with additional info") + require.Equal(t, output, "This is a standard error\ngithub.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_RawFormatter_Format_Beautified (e2h_test.go:143)\n\tError wrapped with additional info") } func TestEnhancedError_EnhErr_JSONFormatter_Format_Beautified(t *testing.T) { @@ -164,7 +165,7 @@ func TestEnhancedError_EnhErr_JSONFormatter_Format_Beautified(t *testing.T) { _, b, _, _ := runtime.Caller(0) hideThisPath := filepath.Dir(b) + string(os.PathSeparator) params := e2hformat.Params{ - PathHidingMethod: e2hformat.HidingMethod_FullBaseline, + PathHidingMethod: formatter.HidingMethod_FullBaseline, PathHidingValue: hideThisPath, Beautify: true, } @@ -173,7 +174,7 @@ func TestEnhancedError_EnhErr_JSONFormatter_Format_Beautified(t *testing.T) { output := jsonFormatter.Format(enhancedErr, params) // Check - require.Equal(t, output, "{\n\t\"error\": \"This is a standard error\",\n\t\"stack_trace\": [\n\t\t{\n\t\t\t\"func\": \"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_JSONFormatter_Format_Beautified\",\n\t\t\t\"caller\": \"e2h_test.go:162\",\n\t\t\t\"context\": \"Error wrapped with additional info\"\n\t\t}\n\t]\n}") + require.Equal(t, output, "{\n\t\"error\": \"This is a standard error\",\n\t\"stack_trace\": [\n\t\t{\n\t\t\t\"func\": \"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_JSONFormatter_Format_Beautified\",\n\t\t\t\"caller\": \"e2h_test.go:163\",\n\t\t\t\"context\": \"Error wrapped with additional info\"\n\t\t}\n\t]\n}") } func TestEnhancedError_EnhErr_RawFormatter_Format_Inverted(t *testing.T) { @@ -184,7 +185,7 @@ func TestEnhancedError_EnhErr_RawFormatter_Format_Inverted(t *testing.T) { _, b, _, _ := runtime.Caller(0) hideThisPath := filepath.Dir(b) + string(os.PathSeparator) params := e2hformat.Params{ - PathHidingMethod: e2hformat.HidingMethod_FullBaseline, + PathHidingMethod: formatter.HidingMethod_FullBaseline, PathHidingValue: hideThisPath, InvertCallstack: true, } @@ -193,7 +194,7 @@ func TestEnhancedError_EnhErr_RawFormatter_Format_Inverted(t *testing.T) { output := rawFormatter.Format(enhancedErr, params) // Check - require.Equal(t, output, "github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_RawFormatter_Format_Inverted (e2h_test.go:182) [Error wrapped with additional info]; This is a standard error;") + require.Equal(t, output, "github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_RawFormatter_Format_Inverted (e2h_test.go:183) [Error wrapped with additional info]; This is a standard error;") } func TestEnhancedError_EnhErr_JSONFormatter_Format_Inverted(t *testing.T) { @@ -204,7 +205,7 @@ func TestEnhancedError_EnhErr_JSONFormatter_Format_Inverted(t *testing.T) { _, b, _, _ := runtime.Caller(0) hideThisPath := filepath.Dir(b) + string(os.PathSeparator) params := e2hformat.Params{ - PathHidingMethod: e2hformat.HidingMethod_FullBaseline, + PathHidingMethod: formatter.HidingMethod_FullBaseline, PathHidingValue: hideThisPath, InvertCallstack: true, } @@ -213,7 +214,7 @@ func TestEnhancedError_EnhErr_JSONFormatter_Format_Inverted(t *testing.T) { output := jsonFormatter.Format(enhancedErr, params) // Check - require.Equal(t, output, "{\"error\":\"This is a standard error\",\"stack_trace\":[{\"func\":\"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_JSONFormatter_Format_Inverted\",\"caller\":\"e2h_test.go:202\",\"context\":\"Error wrapped with additional info\"}]}") + require.Equal(t, output, "{\"error\":\"This is a standard error\",\"stack_trace\":[{\"func\":\"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_JSONFormatter_Format_Inverted\",\"caller\":\"e2h_test.go:203\",\"context\":\"Error wrapped with additional info\"}]}") } func TestEnhancedError_EnhErr_RawFormatter_Format_FullPathHidden(t *testing.T) { @@ -224,7 +225,7 @@ func TestEnhancedError_EnhErr_RawFormatter_Format_FullPathHidden(t *testing.T) { _, b, _, _ := runtime.Caller(0) hideThisPath := filepath.Dir(b) + string(os.PathSeparator) params := e2hformat.Params{ - PathHidingMethod: e2hformat.HidingMethod_FullBaseline, + PathHidingMethod: formatter.HidingMethod_FullBaseline, PathHidingValue: hideThisPath, } @@ -232,7 +233,7 @@ func TestEnhancedError_EnhErr_RawFormatter_Format_FullPathHidden(t *testing.T) { output := rawFormatter.Format(enhancedErr, params) // Check - require.Equal(t, output, "This is a standard error; github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_RawFormatter_Format_FullPathHidden (e2h_test.go:222) [Error wrapped with additional info];") + require.Equal(t, output, "This is a standard error; github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_RawFormatter_Format_FullPathHidden (e2h_test.go:223) [Error wrapped with additional info];") } func TestEnhancedError_EnhErr_JSONFormatter_Format_FullPathHidden(t *testing.T) { @@ -243,7 +244,7 @@ func TestEnhancedError_EnhErr_JSONFormatter_Format_FullPathHidden(t *testing.T) _, b, _, _ := runtime.Caller(0) hideThisPath := filepath.Dir(b) + string(os.PathSeparator) params := e2hformat.Params{ - PathHidingMethod: e2hformat.HidingMethod_FullBaseline, + PathHidingMethod: formatter.HidingMethod_FullBaseline, PathHidingValue: hideThisPath, } @@ -251,7 +252,7 @@ func TestEnhancedError_EnhErr_JSONFormatter_Format_FullPathHidden(t *testing.T) output := jsonFormatter.Format(enhancedErr, params) // Check - require.Equal(t, output, "{\"error\":\"This is a standard error\",\"stack_trace\":[{\"func\":\"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_JSONFormatter_Format_FullPathHidden\",\"caller\":\"e2h_test.go:241\",\"context\":\"Error wrapped with additional info\"}]}") + require.Equal(t, output, "{\"error\":\"This is a standard error\",\"stack_trace\":[{\"func\":\"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_JSONFormatter_Format_FullPathHidden\",\"caller\":\"e2h_test.go:242\",\"context\":\"Error wrapped with additional info\"}]}") } func TestEnhancedError_EnhErr_RawFormatter_Format_PartialPathHidden(t *testing.T) { @@ -262,14 +263,14 @@ func TestEnhancedError_EnhErr_RawFormatter_Format_PartialPathHidden(t *testing.T _, b, _, _ := runtime.Caller(0) path := strings.Split(filepath.Dir(b), string(os.PathSeparator)) params := e2hformat.Params{ - PathHidingMethod: e2hformat.HidingMethod_ToFolder, + PathHidingMethod: formatter.HidingMethod_ToFolder, PathHidingValue: path[len(path)-1], } // Execute output := rawFormatter.Format(enhancedErr, params) - want := strings.ReplaceAll("This is a standard error; github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_RawFormatter_Format_PartialPathHidden (/e2h_test.go:260) [Error wrapped with additional info];", + want := strings.ReplaceAll("This is a standard error; github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_RawFormatter_Format_PartialPathHidden (/e2h_test.go:261) [Error wrapped with additional info];", "", params.PathHidingValue) // Check @@ -284,14 +285,14 @@ func TestEnhancedError_EnhErr_JSONFormatter_Format_PartialPathHidden(t *testing. _, b, _, _ := runtime.Caller(0) path := strings.Split(filepath.Dir(b), string(os.PathSeparator)) params := e2hformat.Params{ - PathHidingMethod: e2hformat.HidingMethod_ToFolder, + PathHidingMethod: formatter.HidingMethod_ToFolder, PathHidingValue: path[len(path)-1], } // Execute output := jsonFormatter.Format(enhancedErr, params) - want := strings.ReplaceAll("{\"error\":\"This is a standard error\",\"stack_trace\":[{\"func\":\"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_JSONFormatter_Format_PartialPathHidden\",\"caller\":\"/e2h_test.go:282\",\"context\":\"Error wrapped with additional info\"}]}", + want := strings.ReplaceAll("{\"error\":\"This is a standard error\",\"stack_trace\":[{\"func\":\"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhErr_JSONFormatter_Format_PartialPathHidden\",\"caller\":\"/e2h_test.go:283\",\"context\":\"Error wrapped with additional info\"}]}", "", params.PathHidingValue) // Check @@ -309,7 +310,7 @@ func TestEnhancedError_EnhError_JSONFormatter_Format_MultipleTraces(t *testing.T hideThisPath := filepath.Dir(b) + string(os.PathSeparator) params := e2hformat.Params{ Beautify: true, - PathHidingMethod: e2hformat.HidingMethod_FullBaseline, + PathHidingMethod: formatter.HidingMethod_FullBaseline, PathHidingValue: hideThisPath, } @@ -317,5 +318,5 @@ func TestEnhancedError_EnhError_JSONFormatter_Format_MultipleTraces(t *testing.T output := jsonFormatter.Format(enhancedErr, params) // Check - require.Equal(t, output, "{\n\t\"error\": \"This is a standard error\",\n\t\"stack_trace\": [\n\t\t{\n\t\t\t\"func\": \"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhError_JSONFormatter_Format_MultipleTraces\",\n\t\t\t\"caller\": \"e2h_test.go:304\",\n\t\t\t\"context\": \"Error wrapped with additional info\"\n\t\t},\n\t\t{\n\t\t\t\"func\": \"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhError_JSONFormatter_Format_MultipleTraces\",\n\t\t\t\"caller\": \"e2h_test.go:305\",\n\t\t\t\"context\": \"This is the 2nd. stack level\"\n\t\t},\n\t\t{\n\t\t\t\"func\": \"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhError_JSONFormatter_Format_MultipleTraces\",\n\t\t\t\"caller\": \"e2h_test.go:306\"\n\t\t}\n\t]\n}") + require.Equal(t, output, "{\n\t\"error\": \"This is a standard error\",\n\t\"stack_trace\": [\n\t\t{\n\t\t\t\"func\": \"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhError_JSONFormatter_Format_MultipleTraces\",\n\t\t\t\"caller\": \"e2h_test.go:305\",\n\t\t\t\"context\": \"Error wrapped with additional info\"\n\t\t},\n\t\t{\n\t\t\t\"func\": \"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhError_JSONFormatter_Format_MultipleTraces\",\n\t\t\t\"caller\": \"e2h_test.go:306\",\n\t\t\t\"context\": \"This is the 2nd. stack level\"\n\t\t},\n\t\t{\n\t\t\t\"func\": \"github.com/cdleo/go-e2h_test.TestEnhancedError_EnhError_JSONFormatter_Format_MultipleTraces\",\n\t\t\t\"caller\": \"e2h_test.go:307\"\n\t\t}\n\t]\n}") } diff --git a/formatter/formatterFactory.go b/formatter/formatterFactory.go index 7b73307..b2d7742 100644 --- a/formatter/formatterFactory.go +++ b/formatter/formatterFactory.go @@ -5,8 +5,8 @@ package e2hformat import ( "fmt" - "path/filepath" - "strings" + + "github.com/cdleo/go-commons/formatter" ) type Format int8 @@ -17,24 +17,13 @@ const ( Format_JSON ) -type HidingMethod int8 - -//Allowed path treatments -const ( - HidingMethod_None HidingMethod = iota - - HidingMethod_FullBaseline - - HidingMethod_ToFolder -) - type Params struct { //Sets if the output will be beautified Beautify bool //Sets if at top of the stack shows the last trace (invert = true) or the origin error (invert = false) InvertCallstack bool //Sets the way in with the filepaths are managed. - PathHidingMethod HidingMethod + PathHidingMethod formatter.HidingMethod //Value to use, according to the selected 'PathHidingMethod' PathHidingValue string } @@ -56,37 +45,3 @@ func NewFormatter(format Format) (Formatter, error) { } } - -// This function format the sourcefile according to the provided params -func formatSourceFile(file string, hidingMethod HidingMethod, hidingValue string) string { - switch hidingMethod { - case HidingMethod_FullBaseline: - return removePathSegment(file, hidingValue) - case HidingMethod_ToFolder: - return removeBeforeFolder(file, hidingValue) - default: //HidingMethod_None - return file - } -} - -// Utility funtion that removes the first part of the filepath til the end of `baseline` path argument -func removePathSegment(file string, baseline string) string { - - file = filepath.Clean(file) - prettyCaller := strings.ReplaceAll(file, baseline, "") - if len(prettyCaller) > 0 { - return prettyCaller - } - - return file -} - -// Utility funtion that removes the first part of the filepath til found the folder indicated in `newRootFolder` argument -func removeBeforeFolder(file string, newRootFolder string) string { - - fileParts := strings.Split(file, newRootFolder) - if len(fileParts) < 2 { - return file - } - return newRootFolder + fileParts[1] -} diff --git a/formatter/jsonFormatter.go b/formatter/jsonFormatter.go index 3771804..498a63a 100644 --- a/formatter/jsonFormatter.go +++ b/formatter/jsonFormatter.go @@ -7,6 +7,7 @@ import ( "encoding/json" "fmt" + "github.com/cdleo/go-commons/formatter" "github.com/cdleo/go-e2h" ) @@ -26,9 +27,9 @@ type jsonSource struct { Context string `json:"context,omitempty"` } -func newJSONStack(item *e2h.StackDetails, hidingMethod HidingMethod, pathOrFolder string) jsonStack { +func newJSONStack(item *e2h.StackDetails, hidingMethod formatter.HidingMethod, pathOrFolder string) jsonStack { - filePath := formatSourceFile(item.File, hidingMethod, pathOrFolder) + filePath := formatter.FormatSourceFile(item.File, hidingMethod, pathOrFolder) return jsonStack{ FuncName: item.FuncName, diff --git a/formatter/rawFormatter.go b/formatter/rawFormatter.go index 152f60f..5927546 100644 --- a/formatter/rawFormatter.go +++ b/formatter/rawFormatter.go @@ -7,6 +7,7 @@ import ( "fmt" "strings" + "github.com/cdleo/go-commons/formatter" "github.com/cdleo/go-e2h" ) @@ -73,7 +74,7 @@ func (s *rawFormatter) Format(err error, params Params) string { func (s *rawFormatter) formatItem(withInfoTrace string, withoutInfoTrace string, params Params, item e2h.StackDetails) string { - filePath := formatSourceFile(item.File, params.PathHidingMethod, params.PathHidingValue) + filePath := formatter.FormatSourceFile(item.File, params.PathHidingMethod, params.PathHidingValue) if len(item.Message) > 0 { return fmt.Sprintf(withInfoTrace, item.FuncName, filePath, item.Line, item.Message) diff --git a/go.mod b/go.mod index f35aa3a..35b84c4 100644 --- a/go.mod +++ b/go.mod @@ -2,9 +2,10 @@ module github.com/cdleo/go-e2h go 1.14 -require github.com/stretchr/testify v1.7.0 +require github.com/stretchr/testify v1.7.1 require ( + github.com/cdleo/go-commons v0.0.0-20220328183115-77de79dd0070 github.com/davecgh/go-spew v1.1.1 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/go.sum b/go.sum index c221f64..6a97a56 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,13 @@ +github.com/cdleo/go-commons v0.0.0-20220328183115-77de79dd0070 h1:bNk0fzPm3BUEiUvkz2n8O5qAbXmb4DH43dtgerkIi+8= +github.com/cdleo/go-commons v0.0.0-20220328183115-77de79dd0070/go.mod h1:BQ8SpAF6lpwFND3DIC8i1/ZsQhcmk2YSrj76gTjgwjw= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=