Skip to content

Commit

Permalink
fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushsatyam146 committed Dec 3, 2024
1 parent 503f91a commit 9693a39
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/wal/wal_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,28 @@ func getEntrySize(data []byte) int {
timestampSize // Timestamp field
}

func (w *WALAOF) validateConfig() error {
if w.logDir == "" {
func (wal *WALAOF) validateConfig() error {
if wal.logDir == "" {
return fmt.Errorf("logDir cannot be empty")
}

if w.maxSegmentSize <= 0 {
if wal.maxSegmentSize <= 0 {
return fmt.Errorf("maxSegmentSize must be greater than 0")
}

if w.maxSegmentCount <= 0 {
if wal.maxSegmentCount <= 0 {
return fmt.Errorf("maxSegmentCount must be greater than 0")
}

if w.bufferSize <= 0 {
if wal.bufferSize <= 0 {
return fmt.Errorf("bufferSize must be greater than 0")
}

if w.walMode == "buffered" && w.writeMode == "fsync" {
if wal.walMode == "buffered" && wal.writeMode == "fsync" {
return fmt.Errorf("walMode 'buffered' cannot be used with writeMode 'fsync'")
}

if w.walMode == "unbuffered" && w.writeMode == "default" {
if wal.walMode == "unbuffered" && wal.writeMode == "default" {
return fmt.Errorf("walMode 'unbuffered' cannot have writeMode as 'default'")
}

Expand Down

0 comments on commit 9693a39

Please sign in to comment.