Skip to content

Commit

Permalink
comments cleanup and function naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mfederowicz committed Nov 1, 2023
1 parent 486785c commit 1cef039
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 1cef039

Please sign in to comment.