Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename storageRecorder to StorageRecorder to fix unexported-return lint error #19341

Merged
Merged
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
22 changes: 11 additions & 11 deletions server/mock/mockstorage/storage_recorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,42 +22,42 @@
"go.etcd.io/raft/v3/raftpb"
)

type storageRecorder struct {
type StorageRecorder struct {
testutil.Recorder
dbPath string // must have '/' suffix if set
}

func NewStorageRecorder(db string) *storageRecorder {
return &storageRecorder{&testutil.RecorderBuffered{}, db}
func NewStorageRecorder(db string) *StorageRecorder {
return &StorageRecorder{&testutil.RecorderBuffered{}, db}
}

func NewStorageRecorderStream(db string) *storageRecorder {
return &storageRecorder{testutil.NewRecorderStream(), db}
func NewStorageRecorderStream(db string) *StorageRecorder {
return &StorageRecorder{testutil.NewRecorderStream(), db}
}

func (p *storageRecorder) Save(st raftpb.HardState, ents []raftpb.Entry) error {
func (p *StorageRecorder) Save(st raftpb.HardState, ents []raftpb.Entry) error {
p.Record(testutil.Action{Name: "Save"})
return nil
}

func (p *storageRecorder) SaveSnap(st raftpb.Snapshot) error {
func (p *StorageRecorder) SaveSnap(st raftpb.Snapshot) error {
if !raft.IsEmptySnap(st) {
p.Record(testutil.Action{Name: "SaveSnap"})
}
return nil
}

func (p *storageRecorder) Release(st raftpb.Snapshot) error {
func (p *StorageRecorder) Release(st raftpb.Snapshot) error {
if !raft.IsEmptySnap(st) {
p.Record(testutil.Action{Name: "Release"})
}
return nil
}

func (p *storageRecorder) Sync() error {
func (p *StorageRecorder) Sync() error {
p.Record(testutil.Action{Name: "Sync"})
return nil
}

func (p *storageRecorder) Close() error { return nil }
func (p *storageRecorder) MinimalEtcdVersion() *semver.Version { return nil }
func (p *StorageRecorder) Close() error { return nil }
func (p *StorageRecorder) MinimalEtcdVersion() *semver.Version { return nil }

Check warning on line 63 in server/mock/mockstorage/storage_recorder.go

View check run for this annotation

Codecov / codecov/patch

server/mock/mockstorage/storage_recorder.go#L63

Added line #L63 was not covered by tests
Loading