Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.18
go-version: 1.23
- name: Checkout
uses: actions/checkout@v1
- name: Get
Expand All @@ -26,7 +26,7 @@ jobs:
go test -tags=pcre2 rare/pkg/fastregex
- name: StaticCheck
run: |
go run honnef.co/go/tools/cmd/staticcheck ./...
go run honnef.co/go/tools/cmd/staticcheck@2024.1.1 ./...
- name: Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ sudo port install rare

Clone the repo, and:

Requires GO 1.18 or higher
Requires GO 1.23 or higher

```sh
go mod download
Expand Down
4 changes: 2 additions & 2 deletions cmd/helpers/updatingAggregator_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package helpers

import (
"io/ioutil"
"io"
"rare/pkg/extractor"
"rare/pkg/extractor/batchers"
"strings"
Expand Down Expand Up @@ -29,7 +29,7 @@ func (s *VirtualAggregator) ParseErrors() uint64 {

func TestAggregationLoop(t *testing.T) {
// Build a real extractor
batcher := batchers.OpenReaderToChan("test", ioutil.NopCloser(strings.NewReader(testData)), 1, 1)
batcher := batchers.OpenReaderToChan("test", io.NopCloser(strings.NewReader(testData)), 1, 1)
ex, err := extractor.New(batcher.BatchChan(), &extractor.Config{
Regex: `(\d+)`,
Extract: "val:{1}",
Expand Down
Binary file added default.pgo
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ sudo port install rare

Clone the repo, and:

Requires GO 1.18 or higher
Requires GO 1.23 or higher

```sh
go mod download
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module rare

go 1.18
go 1.23

require (
github.com/araddon/dateparse v0.0.0-20210207001429-0eec95c9db7e
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I=
github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/araddon/dateparse v0.0.0-20210207001429-0eec95c9db7e h1:OjdSMCht0ZVX7IH0nTdf00xEustvbtUGRgMh3gbdmOg=
github.com/araddon/dateparse v0.0.0-20210207001429-0eec95c9db7e/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
Expand Down
4 changes: 2 additions & 2 deletions pkg/extractor/batchers/readerBatcher_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package batchers

import (
"io/ioutil"
"io"
"strings"
"testing"

"github.com/stretchr/testify/assert"
)

func TestOpenReaderToChan(t *testing.T) {
r := ioutil.NopCloser(strings.NewReader("Hello\nthere\nbob"))
r := io.NopCloser(strings.NewReader("Hello\nthere\nbob"))
b := OpenReaderToChan("src", r, 1, 1)

b1 := <-b.BatchChan()
Expand Down
3 changes: 1 addition & 2 deletions pkg/extractor/batchers/tailBatcher_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package batchers

import (
"io/ioutil"
"os"
"testing"
"time"
Expand All @@ -22,7 +21,7 @@ func TestBatchFollowFile(t *testing.T) {
}

func TestBatchFollowTailFile(t *testing.T) {
tmp, err := ioutil.TempFile("", "followtest-")
tmp, err := os.CreateTemp("", "followtest-")
if err != nil {
panic(err)
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/followreader/followreader_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package followreader

import (
"io/ioutil"
"os"
"sync"
"testing"
Expand Down Expand Up @@ -38,7 +37,7 @@ func CreateAppendingFromFile(filename string) *testAppendingFile {
}

func CreateAppendingTempFile() *testAppendingFile {
f, err := ioutil.TempFile("", "go-test-")
f, err := os.CreateTemp("", "go-test-")
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/followreader/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (s *NotifyFollowReader) Close() error {

func (s *NotifyFollowReader) Drain() error {
if s.f != nil {
_, err := s.f.Seek(0, os.SEEK_END)
_, err := s.f.Seek(0, io.SeekEnd)
return err
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/followreader/poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func NewPolling(filename string, reopen bool) (*PollingFollowReader, error) {

// Drain navigates to the end of the stream
func (s *PollingFollowReader) Drain() error {
offset, err := s.f.Seek(0, os.SEEK_END)
offset, err := s.f.Seek(0, io.SeekEnd)
if err == nil {
s.readBytes = offset
}
Expand Down
Loading