读文件

·  阅读 50

package main

import ( "fmt" "io/ioutil" "os" "time" )

//"net/http"

func main() { filename := os.Args[1] t1 := time.Now() contents, err := ioutil.ReadFile(filename) t2 := time.Now() if err != nil { fmt.Println(err) return } r := string(contents) fmt.Println(r) fmt.Println(t2.Sub(t1))

}

分类:
阅读
标签:
收藏成功!
已添加到「」, 点击更改