• + 2 comments

    Though it is unlikely that anyone did this problem in Go besides me, the same problem occurs when trying to use fmt.Fscan and then scanner.ReadString. The solution is to do the following.

        _, _ = fmt.Fscan(scanner, &mydoub)
        _, _ := scanner.ReadString('\n') //grabs the newline
        mystr, _ := scanner.ReadString('\n')
    

    Additionally, to properly print a float with 1 precision the %.1f verb is used.