Skip to content

Instantly share code, notes, and snippets.

View kush1093's full-sized avatar

Kushal Mestri kush1093

View GitHub Profile
@kush1093
kush1093 / read_line.go
Created April 16, 2018 17:32 — forked from kendellfab/read_line.go
Golang --> Read file line by line.
func readLine(path string) {
inFile, _ := os.Open(path)
defer inFile.Close()
scanner := bufio.NewScanner(inFile)
scanner.Split(bufio.ScanLines)
for scanner.Scan() {
fmt.Println(scanner.Text())
}
}