Created
June 4, 2016 20:02
-
-
Save nanoninja/67b5d21db2948ea37318ecb35cc98dcf to your computer and use it in GitHub Desktop.
Go Cat
This file contains hidden or 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
| // Copyright 2016 The Nanoninja Authors. All rights reserved. | |
| package main | |
| import ( | |
| "io" | |
| "log" | |
| "os" | |
| ) | |
| func main() { | |
| if len(os.Args) <= 1 { | |
| log.Fatal("Filename is not provided") | |
| } | |
| f, err := os.Open(os.Args[1]) | |
| if err != nil { | |
| log.Fatal(err) | |
| } | |
| io.Copy(os.Stdout, f) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment