Skip to content

Conversation

@IntegerAlex
Copy link

add a new Input from Program example that demonstrates scanning interactive user input with fmt.Scanf, including basic validation and error handling

@IntegerAlex
Copy link
Author

IntegerAlex commented Nov 25, 2025

Fix - Feat: #637

Copy link
Collaborator

@eliben eliben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but this is something I have to think about.

Generally the idea of gobyexample isn't to give examples for every possible stdlib function, and fmt already has pretty good examples (e.g. see https://pkg.go.dev/fmt#example-Fscanf)

Personally I find that the *scan* functions aren't commonly used in Go, and bufio.Scanner is much more common (and we already have examples of that)

@@ -0,0 +1,36 @@
// Many programs need a quick way to pull input from the user.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why "Input from Program"? What program is this input from?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants