Initial commit.

This commit is contained in:
Elliott Pardee 2015-04-27 00:18:53 -04:00
commit 6d9fe3e358
2 changed files with 45 additions and 0 deletions

27
bin.go Normal file
View File

@ -0,0 +1,27 @@
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")
}
}

18
typeprint.go Normal file
View File

@ -0,0 +1,18 @@
package main
import (
"fmt"
"time"
)
func typeprint(s string) {
for _, j := range s {
if string(j) == "\n" {
fmt.Printf("\n")
} else {
fmt.Printf("%c", j)
}
time.Sleep(time.Millisecond * time.Duration(10))
}
}