From 01b06790dbb18058d327c4a8819f772f2b20531d Mon Sep 17 00:00:00 2001 From: Daniel Milde Date: Sun, 24 Jan 2021 21:48:06 +0100 Subject: [PATCH] fixed init of ignoreDirPaths --- tui/tui.go | 4 ++++ tui/tui_test.go | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tui/tui.go b/tui/tui.go index 93e494db8..a1eef8565 100644 --- a/tui/tui.go +++ b/tui/tui.go @@ -315,6 +315,10 @@ func (ui *UI) fileItemSelected(row, column int) { func (ui *UI) deviceItemSelected(row, column int) { selectedDevice := ui.table.GetCell(row, column).GetReference().(*analyze.Device) + if ui.ignoreDirPaths == nil { + ui.ignoreDirPaths = make(map[string]bool, 10) + } + for _, device := range ui.devices { if device.Name != selectedDevice.Name && !strings.HasPrefix(selectedDevice.MountPoint, device.MountPoint) { ui.ignoreDirPaths[device.MountPoint] = true diff --git a/tui/tui_test.go b/tui/tui_test.go index db53bef43..2d8a63f8d 100644 --- a/tui/tui_test.go +++ b/tui/tui_test.go @@ -319,7 +319,6 @@ func TestSelectDevice(t *testing.T) { simScreen.SetSize(50, 50) ui := CreateUI(simScreen, true) - ui.SetIgnoreDirPaths([]string{"/"}) ui.analyzer = analyzeMock ui.ListDevices(getDevicesInfoMock)