don't explicitly specify defaults in argument parsing

This commit is contained in:
Daniel Schmidt 2026-02-16 17:32:40 +01:00
parent f7cde006ff
commit acb6ed3f22
No known key found for this signature in database
GPG key ID: 377C3A4D62FBBBE2

View file

@ -17,8 +17,7 @@ func TestParseStateShow_valid(t *testing.T) {
"address only": {
[]string{"test_instance.foo"},
&StateShow{
StatePath: "",
Address: "test_instance.foo",
Address: "test_instance.foo",
},
},
"with state path": {
@ -51,10 +50,7 @@ func TestParseStateShow_invalid(t *testing.T) {
}{
"no arguments": {
nil,
&StateShow{
StatePath: "",
Address: "",
},
&StateShow{},
tfdiags.Diagnostics{
tfdiags.Sourceless(
tfdiags.Error,
@ -66,8 +62,7 @@ func TestParseStateShow_invalid(t *testing.T) {
"too many arguments": {
[]string{"test_instance.foo", "test_instance.bar"},
&StateShow{
StatePath: "",
Address: "test_instance.foo",
Address: "test_instance.foo",
},
tfdiags.Diagnostics{
tfdiags.Sourceless(
@ -79,10 +74,7 @@ func TestParseStateShow_invalid(t *testing.T) {
},
"unknown flag": {
[]string{"-boop"},
&StateShow{
StatePath: "",
Address: "",
},
&StateShow{},
tfdiags.Diagnostics{
tfdiags.Sourceless(
tfdiags.Error,