Skip to content

Instantly share code, notes, and snippets.

@mattgray
Created August 3, 2018 09:11
Show Gist options
  • Save mattgray/1dd927a0163bd6d7a4d20135ba09142d to your computer and use it in GitHub Desktop.
Save mattgray/1dd927a0163bd6d7a4d20135ba09142d to your computer and use it in GitHub Desktop.
mat
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