diff --git a/internal/command/autocomplete.go b/internal/command/autocomplete.go index 766379e2f7..b880bf0849 100644 --- a/internal/command/autocomplete.go +++ b/internal/command/autocomplete.go @@ -43,7 +43,7 @@ func (m *Meta) completePredictWorkspaceName() complete.Predictor { // directory, since we don't have enough context to know where to // find any config path argument, and it might be _after_ the argument // we're trying to complete here anyway. - configPath, err := ModulePath(nil) + configPath, err := modulePath(nil) if err != nil { return nil } diff --git a/internal/command/command.go b/internal/command/command.go index 2ac44aa0f3..0649a5b4e6 100644 --- a/internal/command/command.go +++ b/internal/command/command.go @@ -50,7 +50,7 @@ is configured to use a non-local backend. This backend doesn't support this operation. ` -// ModulePath returns the path to the root module and validates CLI arguments. +// modulePath returns the path to the root module and validates CLI arguments. // // This centralizes the logic for any commands that previously accepted // a module path via CLI arguments. This will error if any extraneous arguments @@ -58,7 +58,7 @@ operation. // // If your command accepts more than one arg, then change the slice bounds // to pass validation. -func ModulePath(args []string) (string, error) { +func modulePath(args []string) (string, error) { // TODO: test if len(args) > 0 { diff --git a/internal/command/console.go b/internal/command/console.go index 4eb20e907e..5e7e44213c 100644 --- a/internal/command/console.go +++ b/internal/command/console.go @@ -35,7 +35,7 @@ func (c *ConsoleCommand) Run(args []string) int { return 1 } - configPath, err := ModulePath(cmdFlags.Args()) + configPath, err := modulePath(cmdFlags.Args()) if err != nil { c.Ui.Error(err.Error()) return 1 diff --git a/internal/command/get.go b/internal/command/get.go index 0a0b5bd159..4ac0c058c0 100644 --- a/internal/command/get.go +++ b/internal/command/get.go @@ -35,7 +35,7 @@ func (c *GetCommand) Run(args []string) int { ctx, done := c.InterruptibleContext(c.CommandContext()) defer done() - path, err := ModulePath(cmdFlags.Args()) + path, err := modulePath(cmdFlags.Args()) if err != nil { c.Ui.Error(err.Error()) return 1 diff --git a/internal/command/graph.go b/internal/command/graph.go index 5fef232eb4..452dad025c 100644 --- a/internal/command/graph.go +++ b/internal/command/graph.go @@ -42,7 +42,7 @@ func (c *GraphCommand) Run(args []string) int { return 1 } - configPath, err := ModulePath(cmdFlags.Args()) + configPath, err := modulePath(cmdFlags.Args()) if err != nil { c.Ui.Error(err.Error()) return 1 diff --git a/internal/command/init.go b/internal/command/init.go index 7e41fc05b2..52709399e1 100644 --- a/internal/command/init.go +++ b/internal/command/init.go @@ -100,7 +100,7 @@ func (c *InitCommand) Run(args []string) int { // Validate the arg count and get the working directory args = cmdFlags.Args() - path, err := ModulePath(args) + path, err := modulePath(args) if err != nil { c.Ui.Error(err.Error()) return 1 diff --git a/internal/command/providers.go b/internal/command/providers.go index 60c87e0355..2f172e4fcb 100644 --- a/internal/command/providers.go +++ b/internal/command/providers.go @@ -41,7 +41,7 @@ func (c *ProvidersCommand) Run(args []string) int { return 1 } - configPath, err := ModulePath(cmdFlags.Args()) + configPath, err := modulePath(cmdFlags.Args()) if err != nil { c.Ui.Error(err.Error()) return 1 diff --git a/internal/command/unlock.go b/internal/command/unlock.go index 6394115e11..523e77b9e2 100644 --- a/internal/command/unlock.go +++ b/internal/command/unlock.go @@ -44,7 +44,7 @@ func (c *UnlockCommand) Run(args []string) int { // assume everything is initialized. The user can manually init if this is // required. - configPath, err := ModulePath(args) + configPath, err := modulePath(args) if err != nil { c.Ui.Error(err.Error()) return 1 diff --git a/internal/command/workspace_delete.go b/internal/command/workspace_delete.go index 1dd4618dfd..314f64aeff 100644 --- a/internal/command/workspace_delete.go +++ b/internal/command/workspace_delete.go @@ -46,7 +46,7 @@ func (c *WorkspaceDeleteCommand) Run(args []string) int { return cli.RunResultHelp } - configPath, err := ModulePath(args[1:]) + configPath, err := modulePath(args[1:]) if err != nil { c.Ui.Error(err.Error()) return 1 diff --git a/internal/command/workspace_list.go b/internal/command/workspace_list.go index 22008e495f..b7cedd31a2 100644 --- a/internal/command/workspace_list.go +++ b/internal/command/workspace_list.go @@ -30,7 +30,7 @@ func (c *WorkspaceListCommand) Run(args []string) int { } args = cmdFlags.Args() - configPath, err := ModulePath(args) + configPath, err := modulePath(args) if err != nil { c.Ui.Error(err.Error()) return 1 diff --git a/internal/command/workspace_new.go b/internal/command/workspace_new.go index 21b37c2d73..6e78b5ea0d 100644 --- a/internal/command/workspace_new.go +++ b/internal/command/workspace_new.go @@ -61,7 +61,7 @@ func (c *WorkspaceNewCommand) Run(args []string) int { return 1 } - configPath, err := ModulePath(args[1:]) + configPath, err := modulePath(args[1:]) if err != nil { c.Ui.Error(err.Error()) return 1 diff --git a/internal/command/workspace_select.go b/internal/command/workspace_select.go index e30693c586..7eaff4231f 100644 --- a/internal/command/workspace_select.go +++ b/internal/command/workspace_select.go @@ -37,7 +37,7 @@ func (c *WorkspaceSelectCommand) Run(args []string) int { return cli.RunResultHelp } - configPath, err := ModulePath(args[1:]) + configPath, err := modulePath(args[1:]) if err != nil { c.Ui.Error(err.Error()) return 1