Merge pull request #3 from ivaaaan/fix-lint-issues

Add more checks for return values from methods
master
Ivan 3 years ago committed by GitHub
commit 0f8af03e74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -84,7 +84,7 @@ func (smug Smug) StartSession(config Config, windows []string) error {
} }
for _, w := range config.Windows { for _, w := range config.Windows {
if (len(windows) == 0 && w.Manual == true) || (len(windows) > 0 && !Contains(windows, w.Name)) { if (len(windows) == 0 && w.Manual) || (len(windows) > 0 && !Contains(windows, w.Name)) {
continue continue
} }
@ -104,7 +104,10 @@ func (smug Smug) StartSession(config Config, windows []string) error {
paneRoot = filepath.Join(windowRoot, p.Root) paneRoot = filepath.Join(windowRoot, p.Root)
} }
smug.tmux.SplitWindow(window, p.Type, paneRoot, p.Commands) _, err = smug.tmux.SplitWindow(window, p.Type, paneRoot, p.Commands)
if err != nil {
return err
}
} }
} }

@ -101,7 +101,10 @@ func TestStartSession(t *testing.T) {
tmux := Tmux{commander} tmux := Tmux{commander}
smug := Smug{tmux, commander} smug := Smug{tmux, commander}
smug.StartSession(params.config, params.windows) err := smug.StartSession(params.config, params.windows)
if err != nil {
t.Fatalf("error %v", err)
}
if !reflect.DeepEqual(params.commands, commander.Commands) { if !reflect.DeepEqual(params.commands, commander.Commands) {
t.Errorf("expected\n%s\ngot\n%s", strings.Join(params.commands, "\n"), strings.Join(commander.Commands, "\n")) t.Errorf("expected\n%s\ngot\n%s", strings.Join(params.commands, "\n"), strings.Join(commander.Commands, "\n"))

Loading…
Cancel
Save