distro: rename awkwardly named function
WithSingleDistro() doesn't follow go's naming convention for creating objects (New*). Rename it to NewRegistry() and rename the old NewRegistry() to NewDefaultRegistry(). The idea is that NewRegistry() can be used to create full Registry objects from outside the package. NewDefaultRegistry() is a convenience function that creates a Registry with all known distros.
This commit is contained in:
parent
60301df8f7
commit
e5eb673be6
14 changed files with 29 additions and 26 deletions
|
|
@ -64,7 +64,7 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
distros := distro.NewRegistry([]string{"."})
|
||||
distros := distro.NewDefaultRegistry([]string{"."})
|
||||
d := distros.GetDistro(distroArg)
|
||||
if d == nil {
|
||||
panic("unknown distro: " + distroArg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue