blob: 869604e048ac015679b6b6df9ee41fabba2d1784 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
package main
import (
"fmt"
"os"
"bufio"
)
func main() {
if len(os.Args) != 2 {
fmt.Fprintf(os.Stderr, "USAGE: %s file\n", os.Args[0])
}
f, err := os.Open(os.Args[1])
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
defer f.Close()
sc := bufio.NewScanner(f)
doPrint := false
for sc.Scan() {
line := sc.Text()
if doPrint {
fmt.Println(line)
}
if line == "----" {
doPrint = true
}
}
}
|