5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 03:40:12 +08:00

Refactor doctor for windows

This commit is contained in:
Lea Anthony 2021-03-20 16:27:35 +11:00
parent bf36b6a59d
commit 9ab06152c5

View File

@ -17,9 +17,6 @@ func platformInfo() (*OS, error) {
// Ignore errors as it isn't a showstopper
key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE)
defer key.Close()
// Ignore errors as it isn't a showstopper
productName, _, _ := key.GetStringValue("ProductName")
currentBuild, _, _ := key.GetStringValue("CurrentBuildNumber")
displayVersion, _, _ := key.GetStringValue("DisplayVersion")
@ -29,5 +26,5 @@ func platformInfo() (*OS, error) {
result.Version = fmt.Sprintf("%s (Build: %s)", releaseId, currentBuild)
result.ID = displayVersion
return &result, nil
return &result, key.Close()
}