12345678910111213141516171819202122232425262728 |
- 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("Please provide a file name as argument")
- }
- input := readInput(os.Args[1])
- fmt.Println(input)
- }
|