diff --git a/test/utils.go b/test/utils.go index 9b8176950..3954423bf 100644 --- a/test/utils.go +++ b/test/utils.go @@ -140,7 +140,7 @@ type instruction struct { Confidence float64 // confidence level } -// structure used when we parse json object insted of classic MATCH string +// JSONInstruction structure used when we parse json object insted of classic MATCH string type JSONInstruction struct { Match string `json:"MATCH"` Category string `json:"Category"` @@ -170,7 +170,7 @@ func parseInstructions(t *testing.T, filename string, src []byte) []instruction } switch extractDataMode(line) { case "json": - jsonInst, err := extractInstructionFromJson(strings.TrimPrefix(line, "json:"), ln) + jsonInst, err := extractInstructionFromJSON(strings.TrimPrefix(line, "json:"), ln) if err != nil { t.Fatalf("At %v:%d: %v", filename, ln, err) } @@ -208,7 +208,7 @@ func parseInstructions(t *testing.T, filename string, src []byte) []instruction return ins } -func extractInstructionFromJson(line string, lineNumber int) (instruction, error) { +func extractInstructionFromJSON(line string, lineNumber int) (instruction, error) { // Use the json.Unmarshal function to parse the JSON into the struct var jsonInst JSONInstruction if err := json.Unmarshal([]byte(line), &jsonInst); err != nil {