Shell: Golang Expected prompt (“$ “) but received “”

I’m stuck on Stage #mg5.

I tried others code as well and anything under the moon go version 1.24.0

Here are my logs:

[tester::#MG5] Running tests for Stage #MG5 (The type builtin: executable files)
[tester::#MG5] [setup] export PATH=/tmp/foo:$PATH
[tester::#MG5] [setup] export PATH=/tmp/baz:$PATH
[tester::#MG5] [setup] export PATH=/tmp/qux:$PATH
[tester::#MG5] [setup] PATH is now: /tmp/qux:/tmp/baz:/tmp/foo:/go/bin:…
[tester::#MG5] [setup] Available executables:
[tester::#MG5] [setup] - my_exe
[tester::#MG5] Running ./your_program.sh
[tester::#MG5] Expected prompt ("$ ") but received “”
[tester::#MG5] Assertion failed.
[tester::#MG5] Test failed (try setting ‘debug: true’ in your codecrafters.yml to see more details)

[tester::#MG5] Running tests for Stage #MG5 (The type builtin: executable files)
[tester::#MG5] [setup] export PATH=/tmp/foo:$PATH
[tester::#MG5] [setup] export PATH=/tmp/qux:$PATH
[tester::#MG5] [setup] export PATH=/tmp/bar:$PATH
[tester::#MG5] [setup] PATH is now: /tmp/bar:/tmp/qux:/tmp/foo:/go/bin:...
[tester::#MG5] [setup] Available executables:
[tester::#MG5] [setup] - my_exe
[tester::#MG5] Running ./your_program.sh
[tester::#MG5] Expected prompt ("$ ") but received ""
[tester::#MG5] Assertion failed.
[tester::#MG5] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)

And here’s a snippet of my code:

	for !shell.Exit {
		fmt.Fprint(os.Stdout, "$ ")

		userIn, err := bufio.NewReader(os.Stdin).ReadString('\n')
		if err != nil {
			fmt.Printf("reader Error %v \n", err)
		}

Hey @Noxire-Hash, looks like the .codecrafters folder was accidentally deleted. I’ve pushed a commit to restore it to your repo. You can run git pull to sync.

Let me know if you’re still hitting any issues!

Wow thanks I didn’t even realized sorry, thanks for fixing it ! (I was trying to fix it for last 3 hours :slight_smile:)

1 Like

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