github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/libkb/osv_darwin.go (about)

     1  //go:build darwin
     2  // +build darwin
     3  
     4  package libkb
     5  
     6  // OSVersionAndBuild returns OS version, and build too on some platforms
     7  func OSVersionAndBuild() (string, string, error) {
     8  	productVersion, err := execToString("/usr/bin/sw_vers", []string{"-productVersion"})
     9  	if err != nil {
    10  		return "", "", err
    11  	}
    12  
    13  	buildVersion, err := execToString("/usr/bin/sw_vers", []string{"-buildVersion"})
    14  	if err != nil {
    15  		return productVersion, "", err
    16  	}
    17  	return productVersion, buildVersion, nil
    18  }