Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
main.go

README.md

stdin-args

A Go example to parse input from the standard input or from an argument.

stdin (directly)

$ go run main.go
I'm running the tool and now it waits for my input which is ended with a new line.
> I'm running the tool and now it waits for my input which is ended with a new line.

stdin (pipe)

$ echo from the pipe | go run main.go
> from the pipe

argument

$ go run main.go "the input is the first argument"
> the input is the first argument