OpenOrCreateKey open a registry key, create it if it doesn't exist.
(key registry.Key, path string, access uint32)
| 57 | |
| 58 | // OpenOrCreateKey open a registry key, create it if it doesn't exist. |
| 59 | func OpenOrCreateKey(key registry.Key, path string, access uint32) (registry.Key, error) { |
| 60 | newk, existing, err := registry.CreateKey(key, path, access) |
| 61 | if err != nil { |
| 62 | return 0, err |
| 63 | } |
| 64 | if existing { |
| 65 | return registry.OpenKey(key, path, access) |
| 66 | } |
| 67 | return newk, nil |
| 68 | } |
| 69 | |
| 70 | // DeleteKey delete a registry key and its sub keys. |
| 71 | func DeleteKey(key registry.Key, path string) error { |
no outgoing calls
no test coverage detected