Created
August 3, 2018 09:11
-
-
Save mattgray/1dd927a0163bd6d7a4d20135ba09142d to your computer and use it in GitHub Desktop.
mat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io" | |
"os" | |
) | |
func main() { | |
filenames := os.Args[1:] | |
for _, f := range filenames { | |
c, err := os.Open(f) | |
if err != nil { | |
fmt.Fprintf(os.Stderr, "error: %s\n", err.Error()) | |
continue | |
} | |
_, err = io.Copy(os.Stdout, c) | |
if err != nil { | |
fmt.Fprintf(os.Stderr, "error: %s\n", err.Error()) | |
os.Exit(1) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment