appease linter

pull/328/head
Jesse Duffield 2 years ago
parent e68554cee9
commit 052c2ec1d1

@ -7,7 +7,6 @@ require (
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
github.com/boz/go-throttle v0.0.0-20160922054636-fdc4eab740c1 github.com/boz/go-throttle v0.0.0-20160922054636-fdc4eab740c1
github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 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/docker/docker v0.7.3-0.20190307005417-54dddadc7d5d
github.com/fatih/color v1.7.0 github.com/fatih/color v1.7.0
github.com/go-errors/errors v1.0.1 github.com/go-errors/errors v1.0.1
@ -29,6 +28,7 @@ require (
require ( require (
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
github.com/Microsoft/go-winio v0.4.14 // 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/distribution v2.7.1+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect github.com/docker/go-units v0.4.0 // indirect
@ -50,6 +50,7 @@ require (
golang.org/x/exp v0.0.0-20220428152302-39d4317da171 // indirect golang.org/x/exp v0.0.0-20220428152302-39d4317da171 // indirect
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 // indirect golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 // indirect
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // 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 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
google.golang.org/grpc v1.22.0 // indirect google.golang.org/grpc v1.22.0 // indirect
gopkg.in/yaml.v2 v2.2.2 // indirect gopkg.in/yaml.v2 v2.2.2 // indirect

@ -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-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 h1:nonptSpoQ4vQjyraW20DXPAglgQfVnM9ZC6MmNLMR60=
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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.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 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

@ -97,7 +97,7 @@ func main() {
stackTrace := newErr.ErrorStack() stackTrace := newErr.ErrorStack()
app.Log.Error(stackTrace) 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)
} }
} }

@ -242,7 +242,6 @@ func (gui *Gui) renderContainerLogsAux(container *commands.Container, stop, noti
gui.Log.Warn(err) gui.Log.Warn(err)
} }
gui.Log.Info("killed container logs process") gui.Log.Info("killed container logs process")
return
}() }()
_ = cmd.Wait() _ = cmd.Wait()
@ -411,7 +410,6 @@ type removeContainerOption struct {
description string description string
command string command string
configOptions types.ContainerRemoveOptions configOptions types.ContainerRemoveOptions
runCommand bool
} }
// GetDisplayStrings is a function. // GetDisplayStrings is a function.

@ -1,8 +1,6 @@
package gui package gui
import ( import (
"strings"
"github.com/go-errors/errors" "github.com/go-errors/errors"
"github.com/jesseduffield/gocui" "github.com/jesseduffield/gocui"
@ -73,5 +71,5 @@ func (gui *Gui) handleCreateOptionsMenu(g *gocui.Gui, v *gocui.View) error {
return bindings[index].Handler(g, v) 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)
} }

@ -126,11 +126,6 @@ func (gui *Gui) renderServiceTop(service *commands.Service) error {
} }
func (gui *Gui) renderServiceLogs(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 { if service.Container == nil {
return gui.T.NewTask(func(stop chan struct{}) { return gui.T.NewTask(func(stop chan struct{}) {
gui.clearMainView() gui.clearMainView()

@ -199,7 +199,6 @@ func (gui *Gui) focusPoint(selectedX int, selectedY int, lineCount int, v *gocui
if originalCy != cy { if originalCy != cy {
_ = v.SetCursor(cx, selectedY-oy) _ = v.SetCursor(cx, selectedY-oy)
} }
return
} }
func (gui *Gui) cleanString(s string) string { func (gui *Gui) cleanString(s string) string {

@ -26,6 +26,7 @@ func dutchSet() TranslationSet {
Execute: "voer uit", Execute: "voer uit",
Close: "sluit", Close: "sluit",
Menu: "menu", Menu: "menu",
MenuTitle: "Menu",
Scroll: "scroll", Scroll: "scroll",
OpenConfig: "open de lazydocker configuratie", OpenConfig: "open de lazydocker configuratie",
EditConfig: "verander de lazydocker configuratie", EditConfig: "verander de lazydocker configuratie",

@ -8,6 +8,7 @@ type TranslationSet struct {
GlobalTitle string GlobalTitle string
Navigate string Navigate string
Menu string Menu string
MenuTitle string
Execute string Execute string
Scroll string Scroll string
Close string Close string
@ -127,6 +128,7 @@ func englishSet() TranslationSet {
Execute: "execute", Execute: "execute",
Close: "close", Close: "close",
Menu: "menu", Menu: "menu",
MenuTitle: "Menu",
Scroll: "scroll", Scroll: "scroll",
OpenConfig: "open lazydocker config", OpenConfig: "open lazydocker config",
EditConfig: "edit lazydocker config", EditConfig: "edit lazydocker config",

@ -25,7 +25,8 @@ func germanSet() TranslationSet {
Navigate: "navigieren", Navigate: "navigieren",
Execute: "ausführen", Execute: "ausführen",
Close: "schließen", Close: "schließen",
Menu: "Menü", Menu: "menü",
MenuTitle: "Menü",
Scroll: "scrollen", Scroll: "scrollen",
OpenConfig: "öffne lazydocker Konfiguration", OpenConfig: "öffne lazydocker Konfiguration",
EditConfig: "bearbeite lazydocker Konfiguration", EditConfig: "bearbeite lazydocker Konfiguration",

@ -12,9 +12,8 @@ import (
// Localizer will translate a message into the user's language // Localizer will translate a message into the user's language
type Localizer struct { type Localizer struct {
language string Log *logrus.Entry
Log *logrus.Entry S TranslationSet
S TranslationSet
} }
func NewTranslationSetFromConfig(log *logrus.Entry, configLanguage string) (*TranslationSet, error) { func NewTranslationSetFromConfig(log *logrus.Entry, configLanguage string) (*TranslationSet, error) {

@ -26,6 +26,7 @@ func polishSet() TranslationSet {
Execute: "wykonaj", Execute: "wykonaj",
Close: "zamknij", Close: "zamknij",
Menu: "menu", Menu: "menu",
MenuTitle: "Menu",
Scroll: "przewiń", Scroll: "przewiń",
OpenConfig: "otwórz konfigurację", OpenConfig: "otwórz konfigurację",
EditConfig: "edytuj konfigurację", EditConfig: "edytuj konfigurację",

@ -26,6 +26,7 @@ func turkishSet() TranslationSet {
Execute: "çalıştır", Execute: "çalıştır",
Close: "kapat", Close: "kapat",
Menu: "menü", Menu: "menü",
MenuTitle: "Menü",
Scroll: "kaydır", Scroll: "kaydır",
OpenConfig: "lazydocker ayarlarını aç", OpenConfig: "lazydocker ayarlarını aç",
EditConfig: "lazzydocker ayarlarını düzenle", EditConfig: "lazzydocker ayarlarını düzenle",

@ -10,14 +10,12 @@ import (
) )
type TaskManager struct { type TaskManager struct {
waitingTask *Task currentTask *Task
currentTask *Task waitingMutex sync.Mutex
waitingMutex sync.Mutex taskIDMutex sync.Mutex
taskIDMutex sync.Mutex Log *logrus.Entry
Log *logrus.Entry Tr *i18n.TranslationSet
Tr *i18n.TranslationSet newTaskId int
waitingTaskAlerts chan struct{}
newTaskId int
} }
type Task struct { type Task struct {
@ -104,7 +102,6 @@ func (t *Task) Stop() {
<-t.notifyStopped <-t.notifyStopped
t.Log.Info("received notifystopped message") t.Log.Info("received notifystopped message")
t.stopped = true t.stopped = true
return
} }
// NewTickerTask is a convenience function for making a new task that repeats some action once per e.g. second // NewTickerTask is a convenience function for making a new task that repeats some action once per e.g. second

@ -1,21 +0,0 @@
package main
import "log"
func main() {
c := make(chan struct{})
close(c)
close(c)
select {
case <-c:
log.Println("hmm")
}
select {
case <-c:
log.Println("okay")
}
}

@ -0,0 +1,11 @@
dependencies:
post:
# install golint
- go get golang.org/x/lint/golint
test:
pre:
# run analysis before tests
- go vet ./...
- test -z "$(golint ./... | tee /dev/stderr)"
- test -z "$(gofmt -s -l . | tee /dev/stderr)"

@ -146,6 +146,8 @@ golang.org/x/net/proxy
golang.org/x/sys/internal/unsafeheader golang.org/x/sys/internal/unsafeheader
golang.org/x/sys/unix golang.org/x/sys/unix
golang.org/x/sys/windows 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 # golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
## explicit ## explicit
# golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 # golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1

Loading…
Cancel
Save