FileOrStdin opens the file at the given path for reading.
func FileOrStdin(stdin io.ReadCloser, path string) (io.ReadCloser, bool, error)FileOrStdin opens the file at the given path for reading. If the path is "-", stdin is returned instead.
It's the caller's responsibility to close the returned ReadCloser (usually with defer).
Returns a boolean indicating whether stdin is being used. If true, no other components of the calling program should attempt to read from stdin for anything else.
| Name | Type | Description |
|---|---|---|
stdin* | io.ReadCloser | |
path* | string |