From 0b2f228954190b56d954ee66dc5d777ad2eced45 Mon Sep 17 00:00:00 2001 From: harakeishi Date: Sat, 11 Feb 2023 12:54:04 +0900 Subject: [PATCH] =?UTF-8?q?lint=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trv/db.go | 4 +++- trv/trv.go | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/trv/db.go b/trv/db.go index 8847161..da9fc32 100644 --- a/trv/db.go +++ b/trv/db.go @@ -25,7 +25,9 @@ func (d *DB) loadData(repo, path string) error { return fmt.Errorf("loadData fail:%w", err) } raw, _ := ioutil.ReadFile(fmt.Sprintf("%s/.trv/%s-%s.json", home, repo, strings.Replace(path, "/", "-", -1))) - json.Unmarshal(raw, &d.Tables) + if err := json.Unmarshal(raw, &d.Tables); err != nil { + return fmt.Errorf("loadData fail:%w", err) + } return nil } diff --git a/trv/trv.go b/trv/trv.go index 5362f14..f168991 100644 --- a/trv/trv.go +++ b/trv/trv.go @@ -2,6 +2,7 @@ package trv import ( "fmt" + "log" "strings" "github.com/gdamore/tcell/v2" @@ -191,7 +192,9 @@ func (t *Trv) setForm() { t.Config.addSource(source) t.Config.saveConfig() t.setSource() - t.addDropdownOption() + if err := t.addDropdownOption(); err != nil { + log.Printf("addDropdownOption fail:%s", err) + } t.Pages.HidePage("modal") }). AddButton("Quit", func() {