|
@@ -0,0 +1,28 @@
|
|
|
+package main
|
|
|
+
|
|
|
+import (
|
|
|
+ "fmt"
|
|
|
+ "io/ioutil"
|
|
|
+ "log"
|
|
|
+ "os"
|
|
|
+ "strings"
|
|
|
+)
|
|
|
+
|
|
|
+func readInput(file string) []string {
|
|
|
+ content, err := ioutil.ReadFile(file)
|
|
|
+ if err != nil {
|
|
|
+ log.Fatal(err)
|
|
|
+ }
|
|
|
+
|
|
|
+ lines := strings.Split(string(content), "\n")
|
|
|
+ return lines
|
|
|
+}
|
|
|
+
|
|
|
+func main() {
|
|
|
+ if len(os.Args) < 2 {
|
|
|
+ log.Fatal("You need to provide path to input file!")
|
|
|
+ }
|
|
|
+
|
|
|
+ lines := readInput(os.Args[1])
|
|
|
+ fmt.Println(lines)
|
|
|
+}
|