1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-23 13:52:26 +08:00

fix: rename Seek to SeekOffset fix go vet check issue

This commit is contained in:
dudaodong
2024-02-20 11:39:41 +08:00
parent da24bae6b4
commit 27d19d1717
3 changed files with 4 additions and 6 deletions

View File

@@ -3,11 +3,9 @@ on:
push: push:
branches: branches:
- main - main
# - v2
pull_request: pull_request:
branches: branches:
- main - main
# - v2
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -17,7 +15,7 @@ jobs:
fetch-depth: 2 fetch-depth: 2
- uses: actions/setup-go@v2 - uses: actions/setup-go@v2
with: with:
go-version: "1.18" go-version: "1.19"
- name: Run coverage - name: Run coverage
run: go test -v ./... -coverprofile=coverage.txt -covermode=atomic run: go test -v ./... -coverprofile=coverage.txt -covermode=atomic
- name: Run govet - name: Run govet

View File

@@ -65,8 +65,8 @@ func (f *FileReader) Offset() int64 {
return f.offset return f.offset
} }
// Seek sets the current offset of the reading // SeekOffset sets the current offset of the reading
func (f *FileReader) Seek(offset int64) error { func (f *FileReader) SeekOffset(offset int64) error {
_, err := f.file.Seek(offset, 0) _, err := f.file.Seek(offset, 0)
if err != nil { if err != nil {
return err return err

View File

@@ -534,7 +534,7 @@ func TestReadlineFile(t *testing.T) {
if !ok { if !ok {
t.Fail() t.Fail()
} }
if err = reader.Seek(offset); err != nil { if err = reader.SeekOffset(offset); err != nil {
t.Fail() t.Fail()
} }
lineRead, err := reader.ReadLine() lineRead, err := reader.ReadLine()