From a02cc010498cf4c2c26a00f87d7679efacf4d996 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 24 Aug 2020 16:10:06 -0400 Subject: [PATCH] Pull an always-nil return value --- ui/ui.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ui/ui.go b/ui/ui.go index d5914f9..eddfd63 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -272,10 +272,8 @@ func update(msg tea.Msg, mdl tea.Model) (tea.Model, tea.Cmd) { // We found a local file case foundLocalFileMsg: - pathStr, err := localFileToMarkdown(m.cwd, gitcha.SearchResult(msg)) - if err == nil { - m.stash.addMarkdowns(pathStr) - } + newMd := localFileToMarkdown(m.cwd, gitcha.SearchResult(msg)) + m.stash.addMarkdowns(newMd) cmds = append(cmds, findNextLocalFile(m)) case sshAuthErrMsg: @@ -515,7 +513,7 @@ func waitForStatusMessageTimeout(appCtx applicationContext, t *time.Timer) tea.C // Convert local file path to Markdown. Note that we could be doing things // like checking if the file is a directory, but we trust that gitcha has // already done that. -func localFileToMarkdown(cwd string, res gitcha.SearchResult) (*markdown, error) { +func localFileToMarkdown(cwd string, res gitcha.SearchResult) *markdown { md := &markdown{ markdownType: localMarkdown, localPath: res.Path, @@ -529,7 +527,7 @@ func localFileToMarkdown(cwd string, res gitcha.SearchResult) (*markdown, error) t := res.Info.ModTime() md.CreatedAt = t - return md, nil + return md } func indent(s string, n int) string {