Skip to content

Commit

Permalink
Bump golangci-lint + fix lint issues
Browse files Browse the repository at this point in the history
Signed-off-by: Volker Theile <[email protected]>
(cherry picked from commit dd16a95)
  • Loading branch information
votdev authored and bk201 committed Apr 18, 2024
1 parent 1806e85 commit 8c30cf1
Show file tree
Hide file tree
Showing 15 changed files with 84 additions and 84 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN zypper -n rm container-suseconnect && \
zypper -n install git curl docker gzip tar wget zstd squashfs xorriso awk jq mtools dosfstools unzip rsync patch
RUN curl -sfL https://github.com/mikefarah/yq/releases/download/v4.21.1/yq_linux_${ARCH} -o /usr/bin/yq && chmod +x /usr/bin/yq
RUN if [ "${ARCH}" == "amd64" ]; then \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.55.2; \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.57.1; \
fi

RUN zypper addrepo http://download.opensuse.org/distribution/leap/15.4/repo/oss/ oss && \
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/coerce.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (t *typeConverter) ToInternal(data map[string]interface{}) error {
return t.mappers.ToInternal(data)
}

func (t *typeConverter) ModifySchema(schema *mapper.Schema, schemas *mapper.Schemas) error {
func (t *typeConverter) ModifySchema(schema *mapper.Schema, _ *mapper.Schemas) error {
for name, field := range schema.ResourceFields {
if field.Type == t.fieldType {
t.mappers = append(t.mappers, fieldConverter{
Expand Down
6 changes: 3 additions & 3 deletions pkg/config/cos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ func TestCalcCosPersistentPartSize(t *testing.T) {
{
diskSize: 300,
partitionSize: "153600Ki",
err: "Partition size must end with 'Mi' or 'Gi'. Decimals and negatives are not allowed.",
err: "Partition size must end with 'Mi' or 'Gi'. Decimals and negatives are not allowed",
},
{
diskSize: 2000,
partitionSize: "1.5Ti",
err: "Partition size must end with 'Mi' or 'Gi'. Decimals and negatives are not allowed.",
err: "Partition size must end with 'Mi' or 'Gi'. Decimals and negatives are not allowed",
},
{
diskSize: 500,
partitionSize: "abcd",
err: "Partition size must end with 'Mi' or 'Gi'. Decimals and negatives are not allowed.",
err: "Partition size must end with 'Mi' or 'Gi'. Decimals and negatives are not allowed",
},
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/rename.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (f *FuzzyNames) addName(name, toName string) {
f.names[strings.ToLower(convert.ToYAMLKey(name))] = toName
}

func (f *FuzzyNames) ModifySchema(schema *mapper.Schema, schemas *mapper.Schemas) error {
func (f *FuzzyNames) ModifySchema(schema *mapper.Schema, _ *mapper.Schemas) error {
f.names = map[string]string{}

for name := range schema.ResourceFields {
Expand Down
2 changes: 1 addition & 1 deletion pkg/console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,6 @@ func setGlobalKeyBindings(g *gocui.Gui) error {
return nil
}

func quit(g *gocui.Gui, v *gocui.View) error {
func quit(_ *gocui.Gui, _ *gocui.View) error {
return gocui.ErrQuit
}
6 changes: 3 additions & 3 deletions pkg/console/dashboard_panels.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func logoPanel(g *gocui.Gui) error {
return nil
}

func toShell(g *gocui.Gui, v *gocui.View) error {
func toShell(g *gocui.Gui, _ *gocui.View) error {
g.Cursor = true
maxX, _ := g.Size()
adminPasswordFrameV := widgets.NewPanel(g, "adminPasswordFrame")
Expand All @@ -191,7 +191,7 @@ func toShell(g *gocui.Gui, v *gocui.View) error {
validatorV.Focus = false

adminPasswordV.KeyBindings = map[gocui.Key]func(*gocui.Gui, *gocui.View) error{
gocui.KeyEnter: func(g *gocui.Gui, v *gocui.View) error {
gocui.KeyEnter: func(_ *gocui.Gui, _ *gocui.View) error {
passwd, err := adminPasswordV.GetData()
if err != nil {
return err
Expand All @@ -205,7 +205,7 @@ func toShell(g *gocui.Gui, v *gocui.View) error {
validatorV.SetContent("Invalid credential or password hash algorithm not supported.")
return nil
},
gocui.KeyEsc: func(g *gocui.Gui, v *gocui.View) error {
gocui.KeyEsc: func(g *gocui.Gui, _ *gocui.View) error {
g.Cursor = false
if err := adminPasswordFrameV.Close(); err != nil {
return err
Expand Down
10 changes: 5 additions & 5 deletions pkg/console/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type passwordWrapper struct {
passwordConfirmV *widgets.Input
}

func (p *passwordWrapper) passwordVConfirmKeyBinding(g *gocui.Gui, v *gocui.View) error {
func (p *passwordWrapper) passwordVConfirmKeyBinding(_ *gocui.Gui, _ *gocui.View) error {
password1V, err := p.c.GetElement(passwordPanel)
if err != nil {
return err
Expand All @@ -28,7 +28,7 @@ func (p *passwordWrapper) passwordVConfirmKeyBinding(g *gocui.Gui, v *gocui.View
return showNext(p.c, passwordConfirmPanel)
}

func (p *passwordWrapper) passwordVEscapeKeyBinding(g *gocui.Gui, v *gocui.View) error {
func (p *passwordWrapper) passwordVEscapeKeyBinding(_ *gocui.Gui, _ *gocui.View) error {
p.passwordV.Close()
p.passwordConfirmV.Close()
if installModeOnly {
Expand All @@ -40,7 +40,7 @@ func (p *passwordWrapper) passwordVEscapeKeyBinding(g *gocui.Gui, v *gocui.View)
return showNext(p.c, tokenPanel)
}

func (p *passwordWrapper) passwordConfirmVArrowUpKeyBinding(g *gocui.Gui, v *gocui.View) error {
func (p *passwordWrapper) passwordConfirmVArrowUpKeyBinding(_ *gocui.Gui, _ *gocui.View) error {
var err error
userInputData.PasswordConfirm, err = p.passwordConfirmV.GetData()
if err != nil {
Expand All @@ -49,7 +49,7 @@ func (p *passwordWrapper) passwordConfirmVArrowUpKeyBinding(g *gocui.Gui, v *goc
return showNext(p.c, passwordPanel)
}

func (p *passwordWrapper) passwordConfirmVKeyEnter(g *gocui.Gui, v *gocui.View) error {
func (p *passwordWrapper) passwordConfirmVKeyEnter(_ *gocui.Gui, _ *gocui.View) error {
var err error
userInputData.PasswordConfirm, err = p.passwordConfirmV.GetData()
if err != nil {
Expand All @@ -72,7 +72,7 @@ func (p *passwordWrapper) passwordConfirmVKeyEnter(g *gocui.Gui, v *gocui.View)
return showNext(p.c, ntpServersPanel)
}

func (p *passwordWrapper) passwordConfirmVKeyEscape(g *gocui.Gui, v *gocui.View) error {
func (p *passwordWrapper) passwordConfirmVKeyEscape(_ *gocui.Gui, _ *gocui.View) error {
p.passwordV.Close()
p.passwordConfirmV.Close()
if err := p.c.setContentByName(notePanel, ""); err != nil {
Expand Down
Loading

0 comments on commit 8c30cf1

Please sign in to comment.