func getOSProductVersion()

in lib/ec2macosinit/util.go [184:196]


func getOSProductVersion() (version string, err error) {
	cmdGetProductVersion := []string{"sysctl", "-n", "kern.osproductversion"}

	output, err := executeCommand(cmdGetProductVersion, "", []string{})
	if err != nil {
		return version, fmt.Errorf("ec2macosinit: error getting kernel state for product version: %s", err)
	}

	// Remove any extra space characters from the output to leave only the product version number
	version = strings.TrimSpace(output.stdout)

	return version, nil
}