You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
381 B

package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"os"
)
func main() {
size := len(os.Args)
if size == 1 {
if _, err := io.Copy(os.Stdout, os.Stdin); err != nil {
log.Fatal(err)
}
} else {
for i := 1; i < size; i++ {
data, err := ioutil.ReadFile(os.Args[i])
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Print(string(data))
}
}
}