diff --git a/testing/test.go b/testing/test.go new file mode 100644 index 0000000..2f2048f --- /dev/null +++ b/testing/test.go @@ -0,0 +1,32 @@ +package main + +import ( + "bufio" + "fmt" + "os" +) + +func main() { + + filePath := os.Args[1] + readFile, err := os.Open(filePath) + + if err != nil { + fmt.Println(err) + } + fileScanner := bufio.NewScanner(readFile) + fileScanner.Split(bufio.ScanLines) + var fileLines []string + + for fileScanner.Scan() { + fileLines = append(fileLines, fileScanner.Text()) + } + + readFile.Close() + + for _, line := range fileLines { + fmt.Println(line) + } + + fmt.Println(fileLines) +} diff --git a/testing/test.txt b/testing/test.txt new file mode 100644 index 0000000..5674acd --- /dev/null +++ b/testing/test.txt @@ -0,0 +1,4 @@ +1 +2 +3 +3425 423