opentofu/internal/command
Martin Atkins e74bf2d0a1 go.mod: Use the new "tool" directive
Previously the Go toolchain had no explicit support for "tools" and so we
used the typical Go community workaround of adding "tools.go" files (two,
for some reason) that existed only to trick the Go toolchain into
considering the tools as dependencies we could track in go.mod.

Go 1.24 introduced explicit support for tracking tools as part of go.mod,
and the ability to run those using "go tool" instead of "go run", and so
this commit switches us over to using that strategy for everything we were
previously managing in tools.go.

There are some intentional exceptions here:

- The protobuf-compile script can't use "go tool" or "go run" because the
  tools in question are run only indirectly through protoc. However, we
  do still use the "tool" directive in go.mod to tell the Go toolchain that
  we depend on those tools, so that it'll track which versions we are
  currently using as part of go.mod.
- Our golangci-lint Makefile target uses "go run" to run a specific
  version of golangci-lint. We _intentionally_ don't consider that tool
  to be a direct dependency of OpenTofu because it has a lot of indirect
  dependencies that would pollute our go.mod file. Therefore that continues
  to use "go run" after this commit.
- Both of our tools.go files previously referred to
  github.com/nishanths/exhaustive , but nothing actually appears to be
  using that tool in the current OpenTofu tree, so it's no longer a
  dependency after this commit.

All of the dependencies we have _only_ for tools are now classified as
"indirect" in the go.mod file. This is the default behavior of the Go
toolchain and appears to be motivated by making it clearer that these
modules do not contribute anything to the runtime behavior of OpenTofu.
This also corrected a historical oddity in our go.mod where for some reason
the "indirect" dependencies had been split across two different "require"
directives; they are now all grouped together in a single directive.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-10-10 07:06:56 -03:00
..
arguments go.mod: Use the new "tool" directive 2025-10-10 07:06:56 -03:00
cliconfig cliconfig: Registry protocol retry count and timeout settings 2025-09-10 11:45:38 -07:00
clistate statemgr+remote: context.Context parameters 2025-07-10 08:11:39 -07:00
e2etest Rework the way ephemeral variables are used when given on tofu apply command (#3192) 2025-09-22 09:31:19 +03:00
format Address review comments 2025-09-10 07:45:23 -04:00
jsonchecks Feature branch: Ephemeral resources (#2852) 2025-08-04 16:39:12 +03:00
jsonconfig fix: Prevent nil panic in marshalProviderConfigs when inSingleModuleMode (#3294) 2025-09-22 13:40:48 +01:00
jsonentities Ephemeral todos handling (#3177) 2025-09-10 07:45:23 -04:00
jsonformat Plan now renders write-only attributes that require replace (#3296) 2025-09-22 17:15:20 +03:00
jsonfunction Fix linting in internal/command (#2798) 2025-05-15 07:39:11 -04:00
jsonplan Show a change reason on enabled meta-argument when deleting (#3248) 2025-09-05 14:38:28 -03:00
jsonprovider Ephemeral write only attributes (#3171) 2025-09-10 07:45:23 -04:00
jsonstate Feature branch: Ephemeral resources (#2852) 2025-08-04 16:39:12 +03:00
testdata fix: TestPlan_generatedConfigPath on Windows by standardizing line breaks (#3274) 2025-09-16 16:11:52 -03:00
testing Ephemeral todos handling (#3177) 2025-09-10 07:45:23 -04:00
views Ephemeral todos handling (#3177) 2025-09-10 07:45:23 -04:00
webbrowser httpclient: Add OTel tracing automatically when needed (#2772) 2025-05-09 10:16:38 +01:00
workdir Fix linting in internal/command (#2798) 2025-05-15 07:39:11 -04:00
alias.go Add new CLI arg to control what warnings should be shown for deprecated outputs/variables (#2705) 2025-05-08 17:01:40 +03:00
apply.go Update apply documentation with the newly accepted -var/-var-file arguments (#3091) 2025-08-01 16:25:39 +03:00
apply_destroy_test.go Use modern helpers from Go's testing.T API (#2692) 2025-04-23 07:48:41 -04:00
apply_test.go fix TestApply_plan_backup test on Windows by using garbage collection (#3320) 2025-09-30 15:49:55 -03:00
autocomplete.go backend: Backend.Workspaces takes context.Context 2025-05-07 14:14:34 -07:00
autocomplete_test.go Fix linting in internal/command (#2798) 2025-05-15 07:39:11 -04:00
cli_ui.go Fix struct names (#1494) 2024-04-25 08:15:46 +02:00
cli_ui_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
command.go Better var file type detection (#1881) 2024-08-02 07:29:40 -04:00
command_test.go fix internal/command tests by triggering garbage collection (#3282) 2025-09-17 09:06:57 -03:00
console.go Add new CLI arg to control what warnings should be shown for deprecated outputs/variables (#2705) 2025-05-08 17:01:40 +03:00
console_interactive.go Fix exit command in console interactive mode (#2086) 2024-10-29 12:13:44 +02:00
console_interactive_test.go fix TestConsole* tests on Windows (#3205) 2025-08-28 20:01:11 -03:00
console_state.go Implement the first part of RFC 20250303-linter-policy (#2577) 2025-03-10 13:16:27 -04:00
console_state_test.go Adds multi line support to console (#1875) 2024-08-02 10:21:44 +01:00
console_test.go fix missing TestConsole* tests on Windows (#3213) 2025-08-29 14:32:33 -03:00
flag_kv.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
flag_kv_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
fmt.go Fix linting in internal/command (#2798) 2025-05-15 07:39:11 -04:00
fmt_test.go Use modern helpers from Go's testing.T API (#2692) 2025-04-23 07:48:41 -04:00
get.go Update help text for static variable support (#1804) 2024-07-11 11:00:18 -04:00
get_test.go httpclient: Add OTel tracing automatically when needed (#2772) 2025-05-09 10:16:38 +01:00
graph.go Add context propagation to Command Meta entrypoint methods (#2735) 2025-04-30 16:28:19 +01:00
graph_test.go Fix linting in internal/command (#2798) 2025-05-15 07:39:11 -04:00
helper.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
hook_module_install.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
import.go Feature branch: Ephemeral resources (#2852) 2025-08-04 16:39:12 +03:00
import_test.go CLI import target validation for incorrect for_each keys (#3106) 2025-09-02 13:21:19 +04:00
init.go backend+command: Alias names for backend types 2025-09-11 11:33:53 -07:00
init_test.go fix: DirFromModule related tests on Windows (#3289) 2025-09-20 15:51:29 -03:00
login.go Adopt OpenTofu's own "svchost" module 2025-06-12 09:37:59 -07:00
login_test.go Adopt OpenTofu's own "svchost" module 2025-06-12 09:37:59 -07:00
logout.go Adopt OpenTofu's own "svchost" module 2025-06-12 09:37:59 -07:00
logout_test.go Adopt OpenTofu's own "svchost" module 2025-06-12 09:37:59 -07:00
meta.go Adopt OpenTofu's own "svchost" module 2025-06-12 09:37:59 -07:00
meta_backend.go backend+command: Alias names for backend types 2025-09-11 11:33:53 -07:00
meta_backend_migrate.go Document -force-copy option in -migrate-state error message 2025-10-07 08:36:30 -04:00
meta_backend_migrate_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
meta_backend_test.go fix TestMeta* on Windows (#3201) 2025-08-28 12:19:00 -03:00
meta_config.go Ephemeral variables (#3108) 2025-09-10 07:45:23 -04:00
meta_dependencies.go command: Only shim dependency lock file for installation actions 2025-07-01 07:44:47 -07:00
meta_encryption.go tofu: EvalContext expression evaluation takes context.Context (#2937) 2025-06-19 10:46:31 +01:00
meta_new.go Initial wiring of encryption through the command package (#1316) 2024-03-07 08:55:57 -05:00
meta_providers.go getproviders: context.Context for source constructor functions 2025-06-13 08:22:47 -07:00
meta_test.go Fix linting in internal/command (#2798) 2025-05-15 07:39:11 -04:00
meta_ui.go add automated copyright header check (#1696) 2024-06-03 16:49:36 +03:00
meta_vars.go Adds prompt for missing static variables (#2047) 2024-10-07 18:30:42 +01:00
meta_vars_test.go Use modern helpers from Go's testing.T API (#2692) 2025-04-23 07:48:41 -04:00
metadata_command.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
metadata_functions.go Integrate provider functions (#1439) 2024-04-10 08:04:08 -04:00
metadata_functions_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
output.go statemgr+remote: context.Context parameters 2025-07-10 08:11:39 -07:00
output_test.go add deprecation warnings support for terraform_remote_state (#2679) 2025-04-25 12:26:28 +03:00
plan.go Rename the CLI arg for deprecation outputs/variables (#2774) 2025-05-09 14:01:32 +03:00
plan_test.go backend+command: Alias names for backend types 2025-09-11 11:33:53 -07:00
plugins.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
plugins_test.go providers: Interface now requires context.Context arguments 2025-05-23 08:58:23 -07:00
providers.go statemgr+remote: context.Context parameters 2025-07-10 08:11:39 -07:00
providers_lock.go command: Only shim dependency lock file for installation actions 2025-07-01 07:44:47 -07:00
providers_lock_test.go Use modern helpers from Go's testing.T API (#2692) 2025-04-23 07:48:41 -04:00
providers_mirror.go command: Only shim dependency lock file for installation actions 2025-07-01 07:44:47 -07:00
providers_mirror_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
providers_schema.go core: tofu.Context.Schemas takes a context.Context 2025-05-08 07:13:19 -07:00
providers_schema_test.go Fix linting in internal/command (#2798) 2025-05-15 07:39:11 -04:00
providers_test.go Use modern helpers from Go's testing.T API (#2692) 2025-04-23 07:48:41 -04:00
push.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
refresh.go Add context propagation to Command Meta entrypoint methods (#2735) 2025-04-30 16:28:19 +01:00
refresh_test.go statemgr+remote: context.Context parameters 2025-07-10 08:11:39 -07:00
show.go Support for static variables used with encrypted plans (#1998) 2025-07-28 12:11:43 -04:00
show_test.go Using forward slashes in PackageDir to fix providercache tests in Windows (#3233) 2025-09-16 09:38:04 -03:00
state_command.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
state_list.go statemgr+remote: context.Context parameters 2025-07-10 08:11:39 -07:00
state_list_test.go Use modern helpers from Go's testing.T API (#2692) 2025-04-23 07:48:41 -04:00
state_meta.go backend: Backend.StateMgr takes context.Context 2025-05-07 14:14:34 -07:00
state_mv.go Feature branch: Ephemeral resources (#2852) 2025-08-04 16:39:12 +03:00
state_mv_test.go Feature branch: Ephemeral resources (#2852) 2025-08-04 16:39:12 +03:00
state_pull.go statemgr+remote: context.Context parameters 2025-07-10 08:11:39 -07:00
state_pull_test.go Use modern helpers from Go's testing.T API (#2692) 2025-04-23 07:48:41 -04:00
state_push.go statemgr+remote: context.Context parameters 2025-07-10 08:11:39 -07:00
state_push_test.go Adapt statelocker usage to Windows (#3206) 2025-09-06 10:47:17 -03:00
state_replace_provider.go statemgr+remote: context.Context parameters 2025-07-10 08:11:39 -07:00
state_replace_provider_test.go Use modern helpers from Go's testing.T API (#2692) 2025-04-23 07:48:41 -04:00
state_rm.go statemgr+remote: context.Context parameters 2025-07-10 08:11:39 -07:00
state_rm_test.go Use modern helpers from Go's testing.T API (#2692) 2025-04-23 07:48:41 -04:00
state_show.go statemgr+remote: context.Context parameters 2025-07-10 08:11:39 -07:00
state_show_test.go Use modern helpers from Go's testing.T API (#2692) 2025-04-23 07:48:41 -04:00
state_test.go Add context propagation to Command Meta entrypoint methods (#2735) 2025-04-30 16:28:19 +01:00
taint.go statemgr+remote: context.Context parameters 2025-07-10 08:11:39 -07:00
taint_test.go Fix linting in internal/command (#2798) 2025-05-15 07:39:11 -04:00
test.go Remove direct uses of golang.org/x/exp 2025-10-09 15:23:05 -07:00
test_test.go Fix test crash when using deprecated outputs in the root module (#3249) 2025-09-05 14:41:32 -04:00
ui_input.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
ui_input_test.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
unlock.go statemgr+remote: context.Context parameters 2025-07-10 08:11:39 -07:00
unlock_test.go Fix linting in internal/command (#2798) 2025-05-15 07:39:11 -04:00
untaint.go statemgr+remote: context.Context parameters 2025-07-10 08:11:39 -07:00
untaint_test.go Fix linting in internal/command (#2798) 2025-05-15 07:39:11 -04:00
validate.go Add context propagation to Command Meta entrypoint methods (#2735) 2025-04-30 16:28:19 +01:00
validate_test.go Fix internal/command/validate_test.go: TestValidate_json* (#3202) 2025-08-29 14:16:47 -03:00
version.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
version_test.go [OpenTelemetry] Add traces to init command (#2665) 2025-04-25 12:40:48 +01:00
workspace_command.go Update copyright notice (#1232) 2024-02-08 09:48:59 +00:00
workspace_command_test.go Close the file handlers in TestWorkspace_deleteWithState after use (#3230) 2025-09-02 16:07:35 -03:00
workspace_delete.go statemgr+remote: context.Context parameters 2025-07-10 08:11:39 -07:00
workspace_list.go backend: Backend.Workspaces takes context.Context 2025-05-07 14:14:34 -07:00
workspace_new.go statemgr+remote: context.Context parameters 2025-07-10 08:11:39 -07:00
workspace_select.go backend: Backend.StateMgr takes context.Context 2025-05-07 14:14:34 -07:00
workspace_show.go Add context propagation to Command Meta entrypoint methods (#2735) 2025-04-30 16:28:19 +01:00