From 8f3d1d99fc5c5860b5e89e9f8279957cda2fee43 Mon Sep 17 00:00:00 2001 From: Malte Bauch <malte.bauch@stud.h-da.de> Date: Wed, 14 Oct 2020 18:29:03 +0200 Subject: [PATCH] fixing lint errrors --- cmd/gosdn-tview/views/commandsListView.go | 16 ++++++++-------- cmd/gosdn-tview/views/mainView.go | 14 +++++++------- cmd/gosdn-tview/views/resultAndInputView.go | 16 ++++++++-------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/cmd/gosdn-tview/views/commandsListView.go b/cmd/gosdn-tview/views/commandsListView.go index cc4dc2502..15dd0126d 100644 --- a/cmd/gosdn-tview/views/commandsListView.go +++ b/cmd/gosdn-tview/views/commandsListView.go @@ -13,33 +13,33 @@ type CommandListView struct { } func NewCommandListView() *CommandListView { - v := &CommandListView{ + cv := &CommandListView{ commandsList: tview.NewList(), } - v.commandsList. + cv.commandsList. SetBorder(true). SetBorderColor(tcell.ColorSteelBlue). SetTitle("Commands") - return v + return cv } -func (c *CommandListView) GetContent() tview.Primitive { - return c.commandsList +func (cv *CommandListView) GetContent() tview.Primitive { + return cv.commandsList } -func (v *CommandListView) GetCommands(app *app.App, rv *ResultAndInputView, +func (cv *CommandListView) GetCommands(app *app.App, rv *ResultAndInputView, conn *grpc.ClientConn) { for i, command := range commands.CommandList { f := command.Function - v.commandsList. + cv.commandsList. AddItem(command.Name, command.Description, rune('a'+i), func() { r := f(conn) rv.SetContent(r) }) } - v.commandsList.AddItem("quit", "closes the application", 'q', func() { + cv.commandsList.AddItem("quit", "closes the application", 'q', func() { app.Stop() }) } diff --git a/cmd/gosdn-tview/views/mainView.go b/cmd/gosdn-tview/views/mainView.go index 4c251af33..e2a1c4c42 100644 --- a/cmd/gosdn-tview/views/mainView.go +++ b/cmd/gosdn-tview/views/mainView.go @@ -14,27 +14,27 @@ type MainView struct { } func NewMainView(app *app.App, conn *grpc.ClientConn) *MainView { - v := &MainView{ + mv := &MainView{ pages: tview.NewPages(), mainFlexBox: createFlexBox(tview.FlexColumn), commandsListView: NewCommandListView(), resultAndInputView: NewResultAndInputView(), } - v.commandsListView.GetCommands(app, v.resultAndInputView, conn) + mv.commandsListView.GetCommands(app, mv.resultAndInputView, conn) commandsFlexBox := createFlexBox(tview.FlexRow) - commandsFlexBox.AddItem(v.commandsListView.GetContent(), 0, 40, true) + commandsFlexBox.AddItem(mv.commandsListView.GetContent(), 0, 40, true) resultAndInputFlexBox := createFlexBox(tview.FlexRow) - resultAndInputFlexBox.AddItem(v.resultAndInputView.GetContent(), 0, 10, false) + resultAndInputFlexBox.AddItem(mv.resultAndInputView.GetContent(), 0, 10, false) - v.mainFlexBox. + mv.mainFlexBox. AddItem(commandsFlexBox, 0, 1, true). AddItem(resultAndInputFlexBox, 0, 4, false) - v.pages.AddPage("main", v.mainFlexBox, true, true) + mv.pages.AddPage("main", mv.mainFlexBox, true, true) - return v + return mv } func (mv *MainView) GetContent() tview.Primitive { diff --git a/cmd/gosdn-tview/views/resultAndInputView.go b/cmd/gosdn-tview/views/resultAndInputView.go index 5be8adf81..b46ca29e3 100644 --- a/cmd/gosdn-tview/views/resultAndInputView.go +++ b/cmd/gosdn-tview/views/resultAndInputView.go @@ -10,10 +10,10 @@ type ResultAndInputView struct { } func NewResultAndInputView() *ResultAndInputView { - v := &ResultAndInputView{ + rv := &ResultAndInputView{ resultAndInputView: tview.NewTextView(), } - v.resultAndInputView. + rv.resultAndInputView. SetDynamicColors(true). SetRegions(true). SetScrollable(true). @@ -21,14 +21,14 @@ func NewResultAndInputView() *ResultAndInputView { SetBorder(true). SetBorderColor(tcell.ColorSteelBlue) - return v + return rv } -func (r *ResultAndInputView) GetContent() tview.Primitive { - return r.resultAndInputView +func (rv *ResultAndInputView) GetContent() tview.Primitive { + return rv.resultAndInputView } -func (r *ResultAndInputView) SetContent(s string) { - r.resultAndInputView.Clear() - r.resultAndInputView.SetText(s) +func (rv *ResultAndInputView) SetContent(s string) { + rv.resultAndInputView.Clear() + rv.resultAndInputView.SetText(s) } -- GitLab