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:
@@ -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 ""
|
||||
}
|
||||
|
||||
@@ -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] != "" {
|
||||
|
||||
Reference in New Issue
Block a user