content, err := ioutil.ReadFile(filename) if err != nil { //Do something } lines := strings.Split(string(content), "\n")