Skip to content

Instantly share code, notes, and snippets.

@portablejim
Created April 2, 2018 10:57
Show Gist options
  • Save portablejim/fd843d530d699ef1d82d815f13dbbed5 to your computer and use it in GitHub Desktop.
Save portablejim/fd843d530d699ef1d82d815f13dbbed5 to your computer and use it in GitHub Desktop.
This does not compile.
package main
import (
"fmt"
"golang.org/x/sys/windows/registry"
)
func main() {
winversion, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE)
if err == nil {
fmt.Printf("Hello world! %v\n", winversion)
} else {
fmt.Printf("Hello, error.\n")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment