diff --git a/internal/common/ignore.go b/internal/common/ignore.go index c39255919..0b8d00323 100644 --- a/internal/common/ignore.go +++ b/internal/common/ignore.go @@ -65,7 +65,7 @@ func (ui *UI) ShouldDirBeIgnoredUsingPattern(name, path string) bool { return shouldIgnore } -// IsHiddenDir returns if the dir name beggins with dot +// IsHiddenDir returns if the dir name begins with dot func (ui *UI) IsHiddenDir(name, path string) bool { shouldIgnore := name[0] == '.' if shouldIgnore { diff --git a/internal/testanalyze/analyze.go b/internal/testanalyze/analyze.go index 3cb0609bb..bef67faba 100644 --- a/internal/testanalyze/analyze.go +++ b/internal/testanalyze/analyze.go @@ -6,10 +6,10 @@ import ( "github.com/dundee/gdu/v5/pkg/analyze" ) -// MockedAnalyzer returns dir with files with diferent size exponents +// MockedAnalyzer returns dir with files with different size exponents type MockedAnalyzer struct{} -// AnalyzeDir returns dir with files with diferent size exponents +// AnalyzeDir returns dir with files with different size exponents func (a *MockedAnalyzer) AnalyzeDir(path string, ignore analyze.ShouldDirBeIgnored) *analyze.Dir { dir := &analyze.Dir{ File: &analyze.File{ diff --git a/pkg/analyze/dir.go b/pkg/analyze/dir.go index 7c8cd3e36..547920231 100644 --- a/pkg/analyze/dir.go +++ b/pkg/analyze/dir.go @@ -15,7 +15,7 @@ type CurrentProgress struct { TotalSize int64 } -var concurrencyLimit chan struct{} = make(chan struct{}, 3*runtime.GOMAXPROCS(0)) +var concurrencyLimit = make(chan struct{}, 3*runtime.GOMAXPROCS(0)) // ShouldDirBeIgnored whether path should be ignored type ShouldDirBeIgnored func(name, path string) bool @@ -94,8 +94,8 @@ func (a *ParallelAnalyzer) processDir(path string) *Dir { err error totalSize int64 info os.FileInfo - subDirChan chan *Dir = make(chan *Dir) - dirCount int = 0 + subDirChan = make(chan *Dir) + dirCount int ) a.wait.Add(1) diff --git a/pkg/device/dev_freebsd.go b/pkg/device/dev_freebsd.go index adceefe00..46094f8be 100644 --- a/pkg/device/dev_freebsd.go +++ b/pkg/device/dev_freebsd.go @@ -57,7 +57,7 @@ func readMountOutput(rdr io.Reader) (Devices, error) { return nil, errors.New("Cannot parse mount output") } - fstype := parts[3][1:len(parts[3])-1] + fstype := parts[3][1 : len(parts[3])-1] device := &Device{ Name: parts[0], diff --git a/tui/tui.go b/tui/tui.go index c88039b6a..1c23aa73d 100644 --- a/tui/tui.go +++ b/tui/tui.go @@ -147,10 +147,7 @@ func CreateUI(app common.TermApplication, useColors bool, showApparentSize bool) // StartUILoop starts tview application func (ui *UI) StartUILoop() error { - if err := ui.app.Run(); err != nil { - return err - } - return nil + return ui.app.Run() } func (ui *UI) rescanDir() {