-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
I am a go language enthusiast and I am just getting started.
Here is my question:
In debug mode, the program is blocked in stdin and cannot be entered.
- What version of Delve are you using (
dlv version
)?
Delve Debugger
Version: 1.0.0
Build: 86120a3b4038318b08c2898059733a7bf1499ee5
- What version of Go are you using? (
go version
)?
go version go1.9.3 darwin/amd64
- What operating system and processor architecture are you using?
Darwin yiji.local 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64
-
What did you do?
In debug mode, the program is blocked in stdin and cannot be entered. -
What did you expect to see?
The program receives input and the debug runs normally. -
What did you see instead?
Here is my simple code :
package main
import (
"bufio"
"os"
"fmt"
)
func main() {
input := bufio.NewScanner(os.Stdin)
words := make(map[string]int)
for input.Scan() {
fmt.Println("Received:" + input.Text())
if len(input.Text()) <= 0 {
break
}
words[input.Text()]++
}
for word, n := range words {
if n > 1 {
fmt.Printf("%d %s\n", n, word)
}
}
}
Is this a bug?
AaronViviano, rxa1031, mniak, sjwl, cam-per and 5 more
Metadata
Metadata
Assignees
Labels
No labels