1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Fix a bunch of minor issues found by running staticcheck

Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
Chris Cummer
2020-05-06 22:44:24 -07:00
parent a19c9c3e33
commit 9cd9a58759
12 changed files with 36 additions and 93 deletions

View File

@@ -103,19 +103,3 @@ func getStatusColor(status string) string {
}
return "red"
}
func pad(t string, size int) string {
if len(t) > size {
return t[0:size-3] + "..."
}
return t + strings.Repeat(" ", size-len(t))
}
func getVarsInPbj(key string, ps []sdk.Parameter) string {
for _, p := range ps {
if p.Name == key {
return p.Value
}
}
return ""
}

View File

@@ -17,7 +17,6 @@ type Widget struct {
view.KeyboardWidget
view.TextWidget
jobs []sdk.WorkflowNodeJobRun
filters []string
client cdsclient.Interface
@@ -119,19 +118,6 @@ func (widget *Widget) HelpText() string {
/* -------------------- Unexported Functions -------------------- */
func (widget *Widget) currentFilter() string {
if len(widget.filters) == 0 {
return sdk.StatusWaiting
}
if widget.Idx < 0 || widget.Idx >= len(widget.filters) {
widget.Idx = 0
return sdk.StatusWaiting
}
return widget.filters[widget.Idx]
}
func (widget *Widget) openWorkflow() {
currentSelection := widget.View.GetHighlights()
if widget.Selected >= 0 && currentSelection[0] != "" {