manu@manu-hacks:~/code/go/self$ go run mycat_v2.go test.txt
this is test file created by goif not existed ,please create this fileif existed, Please write appendhello world,hello gothis is test file created by goif not existed ,please create this fileif existed, Please write appendhello world,hello gomanu@manu-hacks:~/code/go/self$ cat test.txt
this is test file created by go
ifnot existed ,please create this file
if existed, Please write append
hello world,hello go
this is test file created by go
ifnot existed ,please create this file
if existed, Please write append
hello world,hello go
调用部分的代码如下:
f,err:= os.OpenFile(flag.Arg(i),os.O_RDONLY,0660)
...
error:= cat(bufio.NewScanner(f))
iferr!= nil{
fmt.Fprintf(os.Stderr,"%s err read from %s : %s\n",