Refactor names to avoid stutter (#1)

Since client code uses the package name as a prefix when referring to
the package contents, the names for those contents need not repeat the
package name.

- Rename base.BaseCommand to base.Command
- Rename base.BaseServer to base.Server
- Rename config.DevConfig() to config.Dev()
- Rename config.LoadConfigFile() to config.LoadFile()
- Rename config.NewConfig() to config.New()
- Rename config.ParseConfig() to config.Parse()
- Rename controller.ControllerCommand to controller.Command
- Rename controller.NewController() to controller.New()
- Rename dev.DevCommand to dev.Command
- Rename listener.ListenerFactory to listener.Factory
- Rename listener.NewListener() to listener.New()
- Rename version.GetVersion() to version.Get()
- Rename version.VersionInfo to version.Info

See:
- https://golang.org/doc/effective_go.html#package-names
- https://blog.golang.org/package-names#TOC_3.
- https://github.com/golang/go/wiki/CodeReviewComments#package-names
This commit is contained in:
Michael Gaffney authored and GitHub committed 2020-03-10 15:48:04 -04:00
1 parent 39c629631f
commit 5e5a56cac0
14 files changed
+91 -91

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@ type Controller struct {
baseCancel context.CancelFunc
}
func NewController(conf *Config) (*Controller, error) {
func New(conf *Config) (*Controller, error) {
if conf.Logger == nil {
conf.Logger = hclog.New(&hclog.LoggerOptions{
Level: hclog.Trace,