Tester failing me because of a missing escaped char

I’m stuck on Stage #IP1

I’ve tried appending an escaped “\n” to the string response from the executed command in GO but the tester continues to fail me because my response, even though it is correct, does not contain a “\n” in it.

Here are my logs:

[tester::#IP1] Running tests for Stage #IP1 (Run a program)
[tester::#IP1] Running ./your_program.sh
[your-program] $ 
[tester::#IP1] > my_exe Maria
[your-program] Hello maria! The secret code is 5663698145.
[your-program] $ 
[tester::#IP1] Expected first line of output to match "Hello Maria! The secret code is 5663698145.\n", got "Hello maria! The secret code is 5663698145."
[tester::#IP1] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)

And here’s a snippet of my code:

func HandleCommand(command string, args []string) {
  cmd := exec.Command(command, args...)

  output, err := cmd.CombinedOutput()

  if err != nil {
    utils.PrintUnknown(command)
    return
  }

  outputStr := string(output)

  fmt.Print(outputStr)
}

Edit: I might also add that I have tried appending “\n” to the outputStr with no change in response from the tester.

Closing this thread due to inactivity. If you still need assistance, feel free to start a new discussion!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.