diff options
| author | Shulhan <ms@kilabit.info> | 2018-11-30 15:26:05 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2018-11-30 15:26:05 +0700 |
| commit | 34ae901ff30a32d9aef33bfe25561ff2f685cb0c (patch) | |
| tree | 3e3c8dd94965b0f26d1fa21eebeeabfa9d0a7fef /halog.go | |
| parent | c61d03ab8d355ac7d14ee86e29599e67fb2c5a66 (diff) | |
| download | haminer-34ae901ff30a32d9aef33bfe25561ff2f685cb0c.tar.xz | |
all: fix warning from linter
Diffstat (limited to 'halog.go')
| -rw-r--r-- | halog.go | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -11,16 +11,12 @@ import ( "time" ) -var ( - timestampLayout = "2/Jan/2006:15:04:05.000" -) - // // Halog contains the mapping of haproxy HTTP log format to Go struct. // // Reference: https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#8.2.3 // -type Halog struct { +type Halog struct { // nolint: maligned Timestamp time.Time ClientIP string @@ -248,7 +244,7 @@ func (halog *Halog) parseHTTP(in []byte) (ok bool) { halog.HTTPProto, ok = parseToString(in, '"') - return + return ok } // @@ -283,7 +279,7 @@ func (halog *Halog) Parse(in []byte, reqHeaders []string) (ok bool) { return } - halog.Timestamp, err = time.Parse(timestampLayout, ts) + halog.Timestamp, err = time.Parse("2/Jan/2006:15:04:05.000", ts) if err != nil { return false } @@ -366,7 +362,7 @@ func (halog *Halog) Parse(in []byte, reqHeaders []string) (ok bool) { in = in[1:] ok = halog.parseHTTP(in) - return + return ok } // |
