From 16ab444c53b607d0fea5ec7d2633ac548f80f7f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Minier?= Date: Mon, 25 Aug 2025 19:40:55 +0000 Subject: [PATCH] fix: Omit comparison with boolean constant (S1002) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported by staticcheck Signed-off-by: Loïc Minier --- actions/download_action.go | 4 ++-- actions/image_partition_action.go | 4 ++-- actions/pack_action.go | 2 +- archiver.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/actions/download_action.go b/actions/download_action.go index 97665f5..954eb3f 100644 --- a/actions/download_action.go +++ b/actions/download_action.go @@ -115,7 +115,7 @@ func (d *DownloadAction) Verify(context *debos.DebosContext) error { if err != nil { return err } - if d.Unpack == true { + if d.Unpack { if _, err := d.archive(filename); err != nil { return err } @@ -147,7 +147,7 @@ func (d *DownloadAction) Run(context *debos.DebosContext) error { return fmt.Errorf("unsupported URL provided: '%s'", url.String()) } - if d.Unpack == true { + if d.Unpack { archive, err := d.archive(filename) if err != nil { return err diff --git a/actions/image_partition_action.go b/actions/image_partition_action.go index 5433b25..81e8750 100644 --- a/actions/image_partition_action.go +++ b/actions/image_partition_action.go @@ -274,7 +274,7 @@ func (i *ImagePartitionAction) generateFSTab(context *debos.DebosContext) error for _, m := range i.Mountpoints { options := []string{"defaults"} options = append(options, m.Options...) - if m.Buildtime == true { + if m.Buildtime { /* Do not need to add mount point into fstab */ continue } @@ -714,7 +714,7 @@ func (i ImagePartitionAction) Cleanup(context *debos.DebosContext) error { log.Printf("Unmount failure can cause images being incomplete!") return err } - if m.Buildtime == true { + if m.Buildtime { if err = os.Remove(mntpath); err != nil { log.Printf("Failed to remove temporary mount point %s: %s", m.Mountpoint, err) diff --git a/actions/pack_action.go b/actions/pack_action.go index 51f6ef1..91f968c 100644 --- a/actions/pack_action.go +++ b/actions/pack_action.go @@ -85,7 +85,7 @@ func (pf *PackAction) Run(context *debos.DebosContext) error { command = append(command, outfile) command = append(command, "--xattrs") command = append(command, "--xattrs-include=*.*") - if usePigz == true { + if usePigz { command = append(command, "--use-compress-program=pigz") } else if tarOpts[pf.Compression] != "" { command = append(command, tarOpts[pf.Compression]) diff --git a/archiver.go b/archiver.go index 8e46c19..bdb963d 100644 --- a/archiver.go +++ b/archiver.go @@ -115,7 +115,7 @@ func (tar *ArchiveTar) Unpack(destination string) error { if compression, ok := tar.options["tarcompression"]; ok { if unpackTarOpt := tarOptions(compression.(string)); len(unpackTarOpt) > 0 { - if usePigz == true { + if usePigz { command = append(command, "--use-compress-program=pigz") } else { command = append(command, unpackTarOpt)