diff --git a/cmd/gotail/gotail.go b/cmd/gotail/gotail.go index 3da55f2..bdce79e 100644 --- a/cmd/gotail/gotail.go +++ b/cmd/gotail/gotail.go @@ -8,7 +8,7 @@ import ( "fmt" "os" - "github.com/hpcloud/tail" + "git.lovezsh.com/go-kit/tail" ) func args2config() (tail.Config, int64) { diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..7b486d1 --- /dev/null +++ b/go.mod @@ -0,0 +1,8 @@ +module git.lovezsh.com/go-kit/tail + +go 1.16 + +require ( + github.com/fsnotify/fsnotify v1.5.1 + gopkg.in/tomb.v1 v1.0.0-20140529071818-c131134a1947 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..dbc395e --- /dev/null +++ b/go.sum @@ -0,0 +1,6 @@ +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +gopkg.in/tomb.v1 v1.0.0-20140529071818-c131134a1947 h1:aNEcl02ps/eZaBJi2LycKl0jPsUryySSSgrCxieZRYA= +gopkg.in/tomb.v1 v1.0.0-20140529071818-c131134a1947/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= diff --git a/tail.go b/tail.go index c99cdaa..116d929 100644 --- a/tail.go +++ b/tail.go @@ -15,9 +15,9 @@ import ( "sync" "time" - "github.com/hpcloud/tail/ratelimiter" - "github.com/hpcloud/tail/util" - "github.com/hpcloud/tail/watch" + "git.lovezsh.com/go-kit/tail/ratelimiter" + "git.lovezsh.com/go-kit/tail/util" + "git.lovezsh.com/go-kit/tail/watch" "gopkg.in/tomb.v1" ) diff --git a/tail_test.go b/tail_test.go index 38d6b84..25f5a6c 100644 --- a/tail_test.go +++ b/tail_test.go @@ -14,8 +14,8 @@ import ( "testing" "time" - "github.com/hpcloud/tail/ratelimiter" - "github.com/hpcloud/tail/watch" + "git.lovezsh.com/go-kit/tail/ratelimiter" + "git.lovezsh.com/go-kit/tail/watch" ) func init() { diff --git a/tail_windows.go b/tail_windows.go index ef2cfca..87afbc3 100644 --- a/tail_windows.go +++ b/tail_windows.go @@ -3,7 +3,7 @@ package tail import ( - "github.com/hpcloud/tail/winfile" + "git.lovezsh.com/go-kit/tail/winfile" "os" ) diff --git a/util/util.go b/util/util.go index 54151fe..8b19025 100644 --- a/util/util.go +++ b/util/util.go @@ -18,7 +18,7 @@ var LOGGER = &Logger{log.New(os.Stderr, "", log.LstdFlags)} // fatal is like panic except it displays only the current goroutine's stack. func Fatal(format string, v ...interface{}) { - // https://github.com/hpcloud/log/blob/master/log.go#L45 + // https://git.lovezsh.com/go-kit/log/blob/master/log.go#L45 LOGGER.Output(2, fmt.Sprintf("FATAL -- "+format, v...)+"\n"+string(debug.Stack())) os.Exit(1) } diff --git a/watch/inotify.go b/watch/inotify.go index 2bbfe0b..f8993ca 100644 --- a/watch/inotify.go +++ b/watch/inotify.go @@ -8,9 +8,9 @@ import ( "os" "path/filepath" - "github.com/hpcloud/tail/util" + "git.lovezsh.com/go-kit/tail/util" - "gopkg.in/fsnotify/fsnotify.v1" + "github.com/fsnotify/fsnotify" "gopkg.in/tomb.v1" ) diff --git a/watch/inotify_tracker.go b/watch/inotify_tracker.go index 739b3c2..a24b114 100644 --- a/watch/inotify_tracker.go +++ b/watch/inotify_tracker.go @@ -10,9 +10,9 @@ import ( "sync" "syscall" - "github.com/hpcloud/tail/util" + "git.lovezsh.com/go-kit/tail/util" - "gopkg.in/fsnotify/fsnotify.v1" + "github.com/fsnotify/fsnotify" ) type InotifyTracker struct { diff --git a/watch/polling.go b/watch/polling.go index 49491f2..a3ddcf8 100644 --- a/watch/polling.go +++ b/watch/polling.go @@ -8,7 +8,7 @@ import ( "runtime" "time" - "github.com/hpcloud/tail/util" + "git.lovezsh.com/go-kit/tail/util" "gopkg.in/tomb.v1" )