fixing filename, and a file not getting deleted
This commit is contained in:
parent
8213cf927a
commit
ff1db80023
27
bin.go
27
bin.go
@ -1,27 +0,0 @@
|
||||
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")
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user