From 32a8d5a0495c23f77a0c754433ad957bc3fdff88 Mon Sep 17 00:00:00 2001 From: Raphael Cohen Date: Tue, 25 Jul 2023 14:56:18 +0200 Subject: [PATCH] chore: Update module name --- .github/ISSUE_TEMPLATE/bug_report.md | 30 ---------- .github/ISSUE_TEMPLATE/feature_request.md | 25 -------- .github/dependabot.yml | 11 ---- .github/workflows/ci.yml | 25 -------- .github/workflows/codeql-analysis.yml | 71 ----------------------- Dockerfile | 12 ++-- README.md | 20 +++---- cmd/gotail/gotail.go | 7 ++- examples/01-tailAndPrint/main.go | 2 +- examples/02-closeAndReopen/main.go | 2 +- examples/03-consumeJSON/main.go | 4 +- go.mod | 2 +- tail.go | 10 ++-- tail_posix.go | 3 +- tail_test.go | 6 +- tail_windows.go | 5 +- util/util.go | 4 +- watch/filechanges.go | 2 +- watch/inotify.go | 6 +- watch/inotify_tracker.go | 6 +- watch/polling.go | 4 +- watch/watch.go | 2 +- winfile/winfile.go | 3 +- 23 files changed, 50 insertions(+), 212 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 25bd621..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug -assignees: '' - ---- - -If you sent an issue/PR to hpcloud, you can have a look at -[this meta issue](https://github.com/nxadm/tail/issues/6) tracking issues -and PRs of the dormant upstream. However, as the code bases diverge the -issue may have been solved already. - -**Describe the bug** -A clear and concise description of what the bug is. - -**Expected behaviour** -A clear and concise description of what you expected to happen. - -**To Reproduce** -Steps to reproduce the behaviour:, preferably with a code sample. - -**System information** - - tail version [e.g. 1.4.6] - - OS: [e.g. Ubuntu 20.04] -- Arch: [e.g. amd64] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 3beb28d..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: enhancement -assignees: '' - ---- - -If you sent an issue/PR to hpcloud, you can have a look at -[this meta issue](https://github.com/nxadm/tail/issues/6) tracking issues -and PRs of the dormant upstream. However, as the code bases diverge the -issue may have been implemented already. - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index eb4bfe6..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,11 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - - package-ecosystem: "gomod" # See documentation for possible values - directory: "/" # Location of package manifests - schedule: - interval: "daily" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index b855d02..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: ci -on: [push, pull_request] -jobs: - test-build: - strategy: - matrix: - go-version: [1.17.x, 1.16.x, 1.15.x, 1.14.x, 1.13.x, 1.12.x] - os: [ubuntu-20.04, macos-latest, windows-latest] - runs-on: ${{ matrix.os }} - steps: - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Test - run: go test -race -v -timeout 2m ./... - - name: Build lib - run: go build - - name: Build cmd - run: go build - working-directory: ./cmd/gotail diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index aff6199..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,71 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -name: "CodeQL" - -on: - push: - branches: [master, noTomb] - pull_request: - # The branches below must be a subset of the branches above - branches: [master, noTomb] - schedule: - - cron: '0 19 * * 4' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - # Override automatic language detection by changing the below list - # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['go'] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/Dockerfile b/Dockerfile index d963389..09b4188 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,17 @@ FROM golang -RUN mkdir -p $GOPATH/src/github.com/nxadm/tail/ -ADD . $GOPATH/src/github.com/nxadm/tail/ +RUN mkdir -p $GOPATH/src/github.com/SEKOIA-IO/tail/ +ADD . $GOPATH/src/github.com/SEKOIA-IO/tail/ # expecting to fetch dependencies successfully. -RUN go get -v github.com/nxadm/tail +RUN go get -v github.com/SEKOIA-IO/tail # expecting to run the test successfully. -RUN go test -v github.com/nxadm/tail +RUN go test -v github.com/SEKOIA-IO/tail # expecting to install successfully -RUN go install -v github.com/nxadm/tail -RUN go install -v github.com/nxadm/tail/cmd/gotail +RUN go install -v github.com/SEKOIA-IO/tail +RUN go install -v github.com/SEKOIA-IO/tail/cmd/gotail RUN $GOPATH/bin/gotail -h || true diff --git a/README.md b/README.md index fca8901..077a636 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -[![Go Reference](https://pkg.go.dev/badge/github.com/nxadm/tail.svg)](https://pkg.go.dev/github.com/nxadm/tail#section-documentation) -![ci](https://github.com/nxadm/tail/workflows/ci/badge.svg) -[![FreeBSD](https://api.cirrus-ci.com/github/nxadm/tail.svg)](https://cirrus-ci.com/github/nxadm/tail) +[![Go Reference](https://pkg.go.dev/badge/github.com/SEKOIA-IO/tail.svg)](https://pkg.go.dev/github.com/SEKOIA-IO/tail#section-documentation) +![ci](https://github.com/SEKOIA-IO/tail/workflows/ci/badge.svg) +[![FreeBSD](https://api.cirrus-ci.com/github/SEKOIA-IO/tail.svg)](https://cirrus-ci.com/github/SEKOIA-IO/tail) # tail functionality in Go -nxadm/tail provides a Go library that emulates the features of the BSD `tail` +SEKOIA-IO/tail provides a Go library that emulates the features of the BSD `tail` program. The library comes with full support for truncation/move detection as it is designed to work with log rotation tools. The library works on all operating systems supported by Go, including POSIX systems like Linux, *BSD, @@ -25,21 +25,17 @@ for line := range t.Lines { } ``` -See [API documentation](https://pkg.go.dev/github.com/nxadm/tail#section-documentation). +See [API documentation](https://pkg.go.dev/github.com/SEKOIA-IO/tail#section-documentation). ## Installing - go get github.com/nxadm/tail/... + go get github.com/SEKOIA-IO/tail ## History This project is an active, drop-in replacement for the -[abandoned](https://en.wikipedia.org/wiki/HPE_Helion) Go tail library at -[hpcloud](https://github.com/hpcloud/tail). Next to -[addressing open issues/PRs of the original project](https://github.com/nxadm/tail/issues/6), -nxadm/tail continues the development by keeping up to date with the Go toolchain -(e.g. go modules) and dependencies, completing the documentation, adding features -and fixing bugs. +abandoned Go tail library at [nxadm](https://github.com/nxadm/tail) +that itself is a fork of [hpcloud](https://github.com/hpcloud/tail). ## Examples Examples, e.g. used to debug an issue, are kept in the [examples directory](/examples). diff --git a/cmd/gotail/gotail.go b/cmd/gotail/gotail.go index a7fa248..4337e66 100644 --- a/cmd/gotail/gotail.go +++ b/cmd/gotail/gotail.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 FOSS contributors of https://github.com/nxadm/tail +// Copyright (c) 2019 FOSS contributors of https://github.com/SEKOIA-IO/tail // Copyright (c) 2015 HPE Software Inc. All rights reserved. // Copyright (c) 2013 ActiveState Software Inc. All rights reserved. @@ -7,9 +7,10 @@ package main import ( "flag" "fmt" - "io" + "io" "os" - "github.com/nxadm/tail" + + "github.com/SEKOIA-IO/tail" ) func args2config() (tail.Config, int64) { diff --git a/examples/01-tailAndPrint/main.go b/examples/01-tailAndPrint/main.go index c4d07e9..5d4db1d 100644 --- a/examples/01-tailAndPrint/main.go +++ b/examples/01-tailAndPrint/main.go @@ -7,7 +7,7 @@ package main import ( "fmt" - "github.com/nxadm/tail" + "github.com/SEKOIA-IO/tail" ) var logFile = "/var/log/syslog" diff --git a/examples/02-closeAndReopen/main.go b/examples/02-closeAndReopen/main.go index e661b65..21c7b40 100644 --- a/examples/02-closeAndReopen/main.go +++ b/examples/02-closeAndReopen/main.go @@ -8,7 +8,7 @@ import ( "fmt" "time" - "github.com/nxadm/tail" + "github.com/SEKOIA-IO/tail" ) var logFile = "/var/log/syslog" diff --git a/examples/03-consumeJSON/main.go b/examples/03-consumeJSON/main.go index b1ba9c7..544d70a 100644 --- a/examples/03-consumeJSON/main.go +++ b/examples/03-consumeJSON/main.go @@ -11,8 +11,8 @@ import ( "io/ioutil" "os" "strconv" - - "github.com/nxadm/tail" + + "github.com/SEKOIA-IO/tail" ) type jsonStruct struct { diff --git a/go.mod b/go.mod index 09fb13b..1b3d87c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/nxadm/tail +module github.com/SEKOIA-IO/tail go 1.17 diff --git a/tail.go b/tail.go index 667fb68..c5342fa 100644 --- a/tail.go +++ b/tail.go @@ -1,8 +1,8 @@ -// Copyright (c) 2019 FOSS contributors of https://github.com/nxadm/tail +// Copyright (c) 2019 FOSS contributors of https://github.com/SEKOIA-IO/tail // Copyright (c) 2015 HPE Software Inc. All rights reserved. // Copyright (c) 2013 ActiveState Software Inc. All rights reserved. -// nxadm/tail provides a Go library that emulates the features of the BSD `tail` +// SEKOIA-IO/tail provides a Go library that emulates the features of the BSD `tail` // program. The library comes with full support for truncation/move detection as // it is designed to work with log rotation tools. The library works on all // operating systems supported by Go, including POSIX systems like Linux and @@ -21,9 +21,9 @@ import ( "sync" "time" - "github.com/nxadm/tail/ratelimiter" - "github.com/nxadm/tail/util" - "github.com/nxadm/tail/watch" + "github.com/SEKOIA-IO/tail/ratelimiter" + "github.com/SEKOIA-IO/tail/util" + "github.com/SEKOIA-IO/tail/watch" "gopkg.in/tomb.v1" ) diff --git a/tail_posix.go b/tail_posix.go index 23e071d..09db134 100644 --- a/tail_posix.go +++ b/tail_posix.go @@ -1,4 +1,5 @@ -// Copyright (c) 2019 FOSS contributors of https://github.com/nxadm/tail +// Copyright (c) 2019 FOSS contributors of https://github.com/SEKOIA-IO/tail +//go:build !windows // +build !windows package tail diff --git a/tail_test.go b/tail_test.go index 7b9319e..ef26c55 100644 --- a/tail_test.go +++ b/tail_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 FOSS contributors of https://github.com/nxadm/tail +// Copyright (c) 2019 FOSS contributors of https://github.com/SEKOIA-IO/tail // Copyright (c) 2015 HPE Software Inc. All rights reserved. // Copyright (c) 2013 ActiveState Software Inc. All rights reserved. @@ -17,8 +17,8 @@ import ( "testing" "time" - "github.com/nxadm/tail/ratelimiter" - "github.com/nxadm/tail/watch" + "github.com/SEKOIA-IO/tail/ratelimiter" + "github.com/SEKOIA-IO/tail/watch" ) func TestTailFile(t *testing.T) { diff --git a/tail_windows.go b/tail_windows.go index da0d2f3..06b9ab6 100644 --- a/tail_windows.go +++ b/tail_windows.go @@ -1,4 +1,5 @@ -// Copyright (c) 2019 FOSS contributors of https://github.com/nxadm/tail +// Copyright (c) 2019 FOSS contributors of https://github.com/SEKOIA-IO/tail +//go:build windows // +build windows package tail @@ -6,7 +7,7 @@ package tail import ( "os" - "github.com/nxadm/tail/winfile" + "github.com/SEKOIA-IO/tail/winfile" ) // Deprecated: this function is only useful internally and, as such, diff --git a/util/util.go b/util/util.go index b64caa2..d7a2512 100644 --- a/util/util.go +++ b/util/util.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 FOSS contributors of https://github.com/nxadm/tail +// Copyright (c) 2019 FOSS contributors of https://github.com/SEKOIA-IO/tail // Copyright (c) 2015 HPE Software Inc. All rights reserved. // Copyright (c) 2013 ActiveState Software Inc. All rights reserved. @@ -19,7 +19,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/nxadm/log/blob/master/log.go#L45 + // https://github.com/SEKOIA-IO/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/filechanges.go b/watch/filechanges.go index 5b65f42..6f79ba4 100644 --- a/watch/filechanges.go +++ b/watch/filechanges.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 FOSS contributors of https://github.com/nxadm/tail +// Copyright (c) 2019 FOSS contributors of https://github.com/SEKOIA-IO/tail package watch type FileChanges struct { diff --git a/watch/inotify.go b/watch/inotify.go index cbd11ad..f648b0c 100644 --- a/watch/inotify.go +++ b/watch/inotify.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 FOSS contributors of https://github.com/nxadm/tail +// Copyright (c) 2019 FOSS contributors of https://github.com/SEKOIA-IO/tail // Copyright (c) 2015 HPE Software Inc. All rights reserved. // Copyright (c) 2013 ActiveState Software Inc. All rights reserved. @@ -9,9 +9,9 @@ import ( "os" "path/filepath" - "github.com/nxadm/tail/util" + "github.com/SEKOIA-IO/tail/util" - "github.com/fsnotify/fsnotify" + "github.com/fsnotify/fsnotify" "gopkg.in/tomb.v1" ) diff --git a/watch/inotify_tracker.go b/watch/inotify_tracker.go index cb9572a..99f9863 100644 --- a/watch/inotify_tracker.go +++ b/watch/inotify_tracker.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 FOSS contributors of https://github.com/nxadm/tail +// Copyright (c) 2019 FOSS contributors of https://github.com/SEKOIA-IO/tail // Copyright (c) 2015 HPE Software Inc. All rights reserved. // Copyright (c) 2013 ActiveState Software Inc. All rights reserved. @@ -11,9 +11,9 @@ import ( "sync" "syscall" - "github.com/nxadm/tail/util" + "github.com/SEKOIA-IO/tail/util" - "github.com/fsnotify/fsnotify" + "github.com/fsnotify/fsnotify" ) type InotifyTracker struct { diff --git a/watch/polling.go b/watch/polling.go index 74e10aa..95712f6 100644 --- a/watch/polling.go +++ b/watch/polling.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 FOSS contributors of https://github.com/nxadm/tail +// Copyright (c) 2019 FOSS contributors of https://github.com/SEKOIA-IO/tail // Copyright (c) 2015 HPE Software Inc. All rights reserved. // Copyright (c) 2013 ActiveState Software Inc. All rights reserved. @@ -9,7 +9,7 @@ import ( "runtime" "time" - "github.com/nxadm/tail/util" + "github.com/SEKOIA-IO/tail/util" "gopkg.in/tomb.v1" ) diff --git a/watch/watch.go b/watch/watch.go index 2b51128..85b5b69 100644 --- a/watch/watch.go +++ b/watch/watch.go @@ -1,4 +1,4 @@ -// Copyright (c) 2019 FOSS contributors of https://github.com/nxadm/tail +// Copyright (c) 2019 FOSS contributors of https://github.com/SEKOIA-IO/tail // Copyright (c) 2015 HPE Software Inc. All rights reserved. // Copyright (c) 2013 ActiveState Software Inc. All rights reserved. diff --git a/winfile/winfile.go b/winfile/winfile.go index 4562ac7..cd43c86 100644 --- a/winfile/winfile.go +++ b/winfile/winfile.go @@ -1,4 +1,5 @@ -// Copyright (c) 2019 FOSS contributors of https://github.com/nxadm/tail +// Copyright (c) 2019 FOSS contributors of https://github.com/SEKOIA-IO/tail +//go:build windows // +build windows package winfile