common: merge all *ToPtr methods to one generic ToPtr

After introducing Go 1.18 to a project, it's required by law to convert at
least one method to a generic one.

Everyone hates IntToPtr, StringToPtr, BoolToPtr and Uint64ToPtr, so let's
convert them to the ultimate generic ToPtr one.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2023-01-06 12:42:02 +01:00 committed by Achilleas Koutsou
parent 0359647a82
commit b997142db0
46 changed files with 397 additions and 392 deletions

View file

@ -87,9 +87,9 @@ func (img *LiveImage) InstantiateManifest(m *manifest.Manifest,
archivePipeline.Format = osbuild.TarArchiveFormatOldgnu
archivePipeline.RootNode = osbuild.TarRootNodeOmit
// these are required to successfully import the image to GCP
archivePipeline.ACLs = common.BoolToPtr(false)
archivePipeline.SELinux = common.BoolToPtr(false)
archivePipeline.Xattrs = common.BoolToPtr(false)
archivePipeline.ACLs = common.ToPtr(false)
archivePipeline.SELinux = common.ToPtr(false)
archivePipeline.Xattrs = common.ToPtr(false)
archivePipeline.Filename = img.Filename // filename extension will determine compression
default:
panic("invalid image format for image kind")