| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package main
- import (
- "bufio"
- "os"
- "fmt"
- "log"
- "log/syslog"
- )
- func main() {
-
- filePath := os.Args[1]
- cycle, _ := strconv.Atoi(os.Args[2])
- span, _ := strconv.Atoi(os.Args[3])
-
- fmt.Println(cycle, span)
-
- 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)
-
-
-
- /*sysLog, err := syslog.Dial("tcp", "localhost:1234",
- syslog.LOG_WARNING|syslog.LOG_DAEMON, "demotag")
- if err != nil {
- log.Fatal(err)
- }
- fmt.Fprintf(sysLog, "This is a daemon warning with demotag.")
- sysLog.Emerg("And this is a daemon emergency with demotag.")*/
- }
|