pkg/utils: Mark a private function as such

Reading the VERSION_ID field from the host operating system's
os-release(5) only needs to happen when initializing this package.

Fallout from 9e2825524a

https://github.com/containers/toolbox/pull/1304
This commit is contained in:
Debarshi Ray 2023-06-07 16:57:14 +02:00
parent 2568528cb7
commit 4a1d9fc037

View file

@ -140,7 +140,7 @@ func init() {
hostID, err := GetHostID()
if err == nil {
if distroObj, supportedDistro := supportedDistros[hostID]; supportedDistro {
release, err := GetHostVersionID()
release, err := getHostVersionID()
if err == nil {
containerNamePrefixDefault = distroObj.ContainerNamePrefix
distroDefault = hostID
@ -399,11 +399,11 @@ func GetHostVariantID() (string, error) {
return osRelease["VARIANT_ID"], nil
}
// GetHostVersionID returns the VERSION_ID from the os-release files
// getHostVersionID returns the VERSION_ID from the os-release files
//
// Examples:
// - host is Fedora 32, returned string is '32'
func GetHostVersionID() (string, error) {
func getHostVersionID() (string, error) {
osRelease, err := osrelease.Read()
if err != nil {
return "", err