-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
Describe the bug
Scanf fails after host.Init() called.
To Reproduce
Steps to reproduce the behavior:
- Run program
package main
import (
"fmt"
"time"
"periph.io/x/host/v3"
)
func main() {
host.Init()
fmt.Print("Enter times to flash: ")
var repeat int
_, err := fmt.Scanf("%d\n", &repeat)
must("read values", err)
}
func must(m string, e error) {
if e != nil {
panic("failed to " + m + ": " + e.Error())
}
}
- Run it.
- See output
Enter times to flash: panic: failed to read values: read /dev/stdin: bad file descriptor
Expected behavior
fmt.Scanf returns without error and value set.
Platform (please complete the following information):
- OS: Debian GNU/Linux 12
- Board Raspberry Pi 5
Additional context
If I remove the host.Init or call Scanf before it is called, it works fine
Metadata
Metadata
Assignees
Labels
No labels