Restrict functions and structs that aren't used outside of the

nodecontroller to have package private scope. This makes reasoning
about the code in this package much simpler.
This commit is contained in:
Robert Bailey
2015-04-10 15:30:11 -07:00
parent 2823576194
commit f633ac0ab5
3 changed files with 49 additions and 51 deletions

View File

@@ -39,8 +39,7 @@ var providers = make(map[string]Factory)
func RegisterCloudProvider(name string, cloud Factory) {
providersMutex.Lock()
defer providersMutex.Unlock()
_, found := providers[name]
if found {
if _, found := providers[name]; found {
glog.Fatalf("Cloud provider %q was registered twice", name)
}
glog.V(1).Infof("Registered cloud provider %q", name)