Go working on one PC but not another?

Complete GoLang beginner here taking a college course. I have submitted some code that is working fine for me on my computer but my teacher is saying it compiles for him but does not run. I cannot find a solution anywhere and am having a hard time troubleshooting since it works fine for me.

package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var stringsList []string

	for {
		fmt.Print("String to add: ")
		scanner.Scan()
		input := scanner.Text()

		stringsList = append(stringsList, input)

		fmt.Print("Continue? [Y/n]: ")
		scanner.Scan()
		answer := scanner.Text()

		if strings.ToLower(answer) != "y" {
			break
		}
	}

	joinedString := strings.Join(stringsList, ", ")
	fmt.Println(joinedString)
}

Any help is appreciated!!

Worked fine for me and also worked in the playground. Send your teacher a go playground link maybe showing that it runs?

Hi! Probably the problem is that your teacher is testing it with an input file given in stdin or as a param, composed with lines to split? For instance:

person Y
cat y
dog T

Is the only possible problem

Send your executable file to your teacher.