StripTimestamp strips the timestamp from entry and returns it and the rest of the entry.
(ent string)
| 27 | // StripTimestamp strips the timestamp from entry and returns |
| 28 | // it and the rest of the entry. |
| 29 | func StripTimestamp(ent string) (time.Time, string, error) { |
| 30 | ts := ent[:len(TimeFormat)] |
| 31 | rest := ent[len(TimeFormat):] |
| 32 | et, err := time.Parse(TimeFormat, ts) |
| 33 | return et, rest, err |
| 34 | } |
| 35 | |
| 36 | // TimeFormat is a simplified RFC3339 format. |
| 37 | const TimeFormat = "2006-01-02 15:04:05.000" |
no outgoing calls