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 (

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

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

		stringsList = append(stringsList, input)

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

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

	joinedString := strings.Join(stringsList, ", ")

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.