I’m stuck on Stage #OW9 with golang
I’m pretty sure I got the solution right (GitHub - CoderFrogger/OW9)
But when I run the tests I get an error
Here are my logs:
[tester::#OW9] Running tests for Stage #OW9 (Parse torrent file)
[tester::#OW9] Running ./your_bittorrent.sh info /tmp/torrents3719957302/itsworking.gif.torrent
[your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce
[your_program] Length : 2549700
[tester::#OW9] Checking for tracker URL (Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce)
[tester::#OW9] Tracker URL is correct
[tester::#OW9] Checking for length (Length: 2549700)
[tester::#OW9] Expected stdout to contain "Length: 2549700", got: "Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce\nLength : 2549700\n"
[tester::#OW9] Test failed
At first I thought my output might be the culprit since I used \n
fmt.Printf("Tracker URL: %v\n", decodedFile["announce"])
fmt.Printf("Length : %v\n", downloadLength["length"])
But even when I changed it to fmt.Println()
the issue persists.
I tried downloading the test torrent files and my app runs with them with no issues