Skip to content

Commit

Permalink
fix staticcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
laktak committed Nov 29, 2024
1 parent e33b651 commit 9841d64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ type Context struct {
WorkQueue chan *WorkItem
LogQueue chan *LogEvent
PerfQueue chan *PerfEvent
wg sync.WaitGroup

mutex sync.Mutex
NumTotal int
Expand All @@ -36,10 +35,10 @@ type Context struct {

func NewContext(numWorkers int, hashAlgo string, indexFilename string, ignoreFilename string) (*Context, error) {
if indexFilename[0] != '.' {
return nil, errors.New("The index filename must start with a dot!")
return nil, errors.New("the index filename must start with a dot")
}
if ignoreFilename[0] != '.' {
return nil, errors.New("The ignore filename must start with a dot!")
return nil, errors.New("the ignore filename must start with a dot")
}
if hashAlgo != "md5" && hashAlgo != "sha512" && hashAlgo != "blake3" {
return nil, errors.New(hashAlgo + " is unknown.")
Expand Down
2 changes: 1 addition & 1 deletion index.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (i *Index) calcFile(name string, a string) (*idxInfo, error) {
func (i *Index) save() (bool, error) {
if i.modified {
if i.readonly {
return false, errors.New("Error trying to save a readonly index.")
return false, errors.New("error trying to save a readonly index")
}

text, err := json.Marshal(i.new)
Expand Down

0 comments on commit 9841d64

Please sign in to comment.