Go Text File Read
package main // www. j a va 2s .c om import ( "fmt" "io/ioutil" ) func main() { bs, err := ioutil.ReadFile("main.go") if err != nil { return } str := string(bs) fmt.Println(str) }