mirror of
https://github.com/outbackdingo/debos.git
synced 2026-01-27 10:18:47 +00:00
fix: Omit comparison with boolean constant (S1002)
Reported by staticcheck Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user