/usr/share/gocode/src/github.com/jeromer/syslogparser/rfc3164/example_test.go is in golang-github-jeromer-syslogparser-dev 0~20150717.ff71fe7a-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | package rfc3164_test
import (
"fmt"
"github.com/jeromer/syslogparser/rfc3164"
)
func ExampleNewParser() {
b := "<34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvick on /dev/pts/8"
buff := []byte(b)
p := rfc3164.NewParser(buff)
err := p.Parse()
if err != nil {
panic(err)
}
fmt.Println(p.Dump())
}
|