From c5b73d348500e127fc50788ee93ef5a6f740cc96 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 14 Nov 2013 09:44:28 -0800 Subject: [PATCH] add NewLine helper to create a Line instance --- tail.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tail.go b/tail.go index 61a8cd2..b915300 100644 --- a/tail.go +++ b/tail.go @@ -24,6 +24,11 @@ type Line struct { Err error // Error from tail } +// NewLine returns a Line with present time. +func NewLine(text string) *Line { + return &Line{text, time.Now(), nil} +} + // SeekInfo represents arguments to `os.Seek` type SeekInfo struct { Offset int64