typeprint/bin.go

28 lines
378 B
Go
Raw Normal View History

2015-04-27 00:18:53 -04:00
package main
import (
"os"
"io/ioutil"
"fmt"
)
func processFile(filename string) {
file, err := ioutil.ReadFile(filename)
if err != nil {
panic(err)
}
typeprint(string(file))
}
func main() {
args := os.Args[1:]
if len(args) == 1 {
processFile(args[0])
} else {
fmt.Println("needs a file to process")
}
}