Skip to content

Commit

Permalink
appease linter
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseduffield committed May 10, 2022
1 parent e68554c commit 052c2ec
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 48 deletions.
3 changes: 2 additions & 1 deletion go.mod
Expand Up @@ -7,7 +7,6 @@ require (
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
github.com/boz/go-throttle v0.0.0-20160922054636-fdc4eab740c1
github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21
github.com/davecgh/go-spew v1.1.1
github.com/docker/docker v0.7.3-0.20190307005417-54dddadc7d5d
github.com/fatih/color v1.7.0
github.com/go-errors/errors v1.0.1
Expand All @@ -29,6 +28,7 @@ require (
require (
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
github.com/Microsoft/go-winio v0.4.14 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
Expand All @@ -50,6 +50,7 @@ require (
golang.org/x/exp v0.0.0-20220428152302-39d4317da171 // indirect
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 // indirect
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
google.golang.org/grpc v1.22.0 // indirect
gopkg.in/yaml.v2 v2.2.2 // indirect
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Expand Up @@ -123,8 +123,9 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 h1:nonptSpoQ4vQjyraW20DXPAglgQfVnM9ZC6MmNLMR60=
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
2 changes: 1 addition & 1 deletion main.go
Expand Up @@ -97,7 +97,7 @@ func main() {
stackTrace := newErr.ErrorStack()
app.Log.Error(stackTrace)

log.Fatal(fmt.Sprintf("%s\n\n%s", app.Tr.ErrorOccurred, stackTrace))
log.Fatalf("%s\n\n%s", app.Tr.ErrorOccurred, stackTrace)
}
}

Expand Down
2 changes: 0 additions & 2 deletions pkg/gui/containers_panel.go
Expand Up @@ -242,7 +242,6 @@ func (gui *Gui) renderContainerLogsAux(container *commands.Container, stop, noti
gui.Log.Warn(err)
}
gui.Log.Info("killed container logs process")
return
}()

_ = cmd.Wait()
Expand Down Expand Up @@ -411,7 +410,6 @@ type removeContainerOption struct {
description string
command string
configOptions types.ContainerRemoveOptions
runCommand bool
}

// GetDisplayStrings is a function.
Expand Down
4 changes: 1 addition & 3 deletions pkg/gui/options_menu_panel.go
@@ -1,8 +1,6 @@
package gui

import (
"strings"

"github.com/go-errors/errors"

"github.com/jesseduffield/gocui"
Expand Down Expand Up @@ -73,5 +71,5 @@ func (gui *Gui) handleCreateOptionsMenu(g *gocui.Gui, v *gocui.View) error {
return bindings[index].Handler(g, v)
}

return gui.createMenu(strings.Title(gui.Tr.Menu), bindings, len(bindings), handleMenuPress)
return gui.createMenu(gui.Tr.MenuTitle, bindings, len(bindings), handleMenuPress)
}
5 changes: 0 additions & 5 deletions pkg/gui/services_panel.go
Expand Up @@ -126,11 +126,6 @@ func (gui *Gui) renderServiceTop(service *commands.Service) error {
}

func (gui *Gui) renderServiceLogs(service *commands.Service) error {
service, err := gui.getSelectedService()
if err != nil {
return nil
}

if service.Container == nil {
return gui.T.NewTask(func(stop chan struct{}) {
gui.clearMainView()
Expand Down
1 change: 0 additions & 1 deletion pkg/gui/view_helpers.go
Expand Up @@ -199,7 +199,6 @@ func (gui *Gui) focusPoint(selectedX int, selectedY int, lineCount int, v *gocui
if originalCy != cy {
_ = v.SetCursor(cx, selectedY-oy)
}
return
}

func (gui *Gui) cleanString(s string) string {
Expand Down
1 change: 1 addition & 0 deletions pkg/i18n/dutch.go
Expand Up @@ -26,6 +26,7 @@ func dutchSet() TranslationSet {
Execute: "voer uit",
Close: "sluit",
Menu: "menu",
MenuTitle: "Menu",
Scroll: "scroll",
OpenConfig: "open de lazydocker configuratie",
EditConfig: "verander de lazydocker configuratie",
Expand Down
2 changes: 2 additions & 0 deletions pkg/i18n/english.go
Expand Up @@ -8,6 +8,7 @@ type TranslationSet struct {
GlobalTitle string
Navigate string
Menu string
MenuTitle string
Execute string
Scroll string
Close string
Expand Down Expand Up @@ -127,6 +128,7 @@ func englishSet() TranslationSet {
Execute: "execute",
Close: "close",
Menu: "menu",
MenuTitle: "Menu",
Scroll: "scroll",
OpenConfig: "open lazydocker config",
EditConfig: "edit lazydocker config",
Expand Down
3 changes: 2 additions & 1 deletion pkg/i18n/german.go
Expand Up @@ -25,7 +25,8 @@ func germanSet() TranslationSet {
Navigate: "navigieren",
Execute: "ausführen",
Close: "schließen",
Menu: "Menü",
Menu: "menü",
MenuTitle: "Menü",
Scroll: "scrollen",
OpenConfig: "öffne lazydocker Konfiguration",
EditConfig: "bearbeite lazydocker Konfiguration",
Expand Down
5 changes: 2 additions & 3 deletions pkg/i18n/i18n.go
Expand Up @@ -12,9 +12,8 @@ import (

// Localizer will translate a message into the user's language
type Localizer struct {
language string
Log *logrus.Entry
S TranslationSet
Log *logrus.Entry
S TranslationSet
}

func NewTranslationSetFromConfig(log *logrus.Entry, configLanguage string) (*TranslationSet, error) {
Expand Down
1 change: 1 addition & 0 deletions pkg/i18n/polish.go
Expand Up @@ -26,6 +26,7 @@ func polishSet() TranslationSet {
Execute: "wykonaj",
Close: "zamknij",
Menu: "menu",
MenuTitle: "Menu",
Scroll: "przewiń",
OpenConfig: "otwórz konfigurację",
EditConfig: "edytuj konfigurację",
Expand Down
1 change: 1 addition & 0 deletions pkg/i18n/turkish.go
Expand Up @@ -26,6 +26,7 @@ func turkishSet() TranslationSet {
Execute: "çalıştır",
Close: "kapat",
Menu: "menü",
MenuTitle: "Menü",
Scroll: "kaydır",
OpenConfig: "lazydocker ayarlarını aç",
EditConfig: "lazzydocker ayarlarını düzenle",
Expand Down
15 changes: 6 additions & 9 deletions pkg/tasks/tasks.go
Expand Up @@ -10,14 +10,12 @@ import (
)

type TaskManager struct {
waitingTask *Task
currentTask *Task
waitingMutex sync.Mutex
taskIDMutex sync.Mutex
Log *logrus.Entry
Tr *i18n.TranslationSet
waitingTaskAlerts chan struct{}
newTaskId int
currentTask *Task
waitingMutex sync.Mutex
taskIDMutex sync.Mutex
Log *logrus.Entry
Tr *i18n.TranslationSet
newTaskId int
}

type Task struct {
Expand Down Expand Up @@ -104,7 +102,6 @@ func (t *Task) Stop() {
<-t.notifyStopped
t.Log.Info("received notifystopped message")
t.stopped = true
return
}

// NewTickerTask is a convenience function for making a new task that repeats some action once per e.g. second
Expand Down
21 changes: 0 additions & 21 deletions test/testmain/main.go

This file was deleted.

11 changes: 11 additions & 0 deletions vendor/github.com/docker/go-units/circle.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions vendor/modules.txt
Expand Up @@ -146,6 +146,8 @@ golang.org/x/net/proxy
golang.org/x/sys/internal/unsafeheader
golang.org/x/sys/unix
golang.org/x/sys/windows
# golang.org/x/text v0.3.7
## explicit; go 1.17
# golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
## explicit
# golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
Expand Down

0 comments on commit 052c2ec

Please sign in to comment.