diff --git a/cmd/disable/disable_test.go b/cmd/disable/disable_test.go index 03865bc..088db2d 100644 --- a/cmd/disable/disable_test.go +++ b/cmd/disable/disable_test.go @@ -6,7 +6,7 @@ import ( "github.com/jippi/dottie/pkg/test_helpers" ) -func TestCommand(t *testing.T) { +func TestDisableCommand(t *testing.T) { t.Parallel() test_helpers.RunFileBasedCommandTests(t, 0, "disable") diff --git a/cmd/disable/tests/disable-a-key-already-disabled/stdout.golden b/cmd/disable/tests/disable-a-key-already-disabled/stdout.golden index b9de686..b8fe0b5 100644 --- a/cmd/disable/tests/disable-a-key-already-disabled/stdout.golden +++ b/cmd/disable/tests/disable-a-key-already-disabled/stdout.golden @@ -1 +1,2 @@ ---- exec command line 0: [disable KEY_B] +(no output to stdout) diff --git a/cmd/disable/tests/disable-key-b/stderr.golden b/cmd/disable/tests/disable-key-b/stderr.golden index b9de686..7a47971 100644 --- a/cmd/disable/tests/disable-key-b/stderr.golden +++ b/cmd/disable/tests/disable-key-b/stderr.golden @@ -1 +1,2 @@ ---- exec command line 0: [disable KEY_B] +(no output to stderr) diff --git a/cmd/disable/tests/invalid-key/stdout.golden b/cmd/disable/tests/invalid-key/stdout.golden index cc62e8b..f791f4f 100644 --- a/cmd/disable/tests/invalid-key/stdout.golden +++ b/cmd/disable/tests/invalid-key/stdout.golden @@ -1 +1,2 @@ ---- exec command line 0: [disable NONEXISTING_KEY] +(no output to stdout) diff --git a/cmd/disable/tests/missing-key/stdout.golden b/cmd/disable/tests/missing-key/stdout.golden index faefdb7..ade1f17 100644 --- a/cmd/disable/tests/missing-key/stdout.golden +++ b/cmd/disable/tests/missing-key/stdout.golden @@ -1 +1,2 @@ ---- exec command line 0: [disable] +(no output to stdout) diff --git a/cmd/enable/enable_test.go b/cmd/enable/enable_test.go index 2394256..42eed73 100644 --- a/cmd/enable/enable_test.go +++ b/cmd/enable/enable_test.go @@ -6,7 +6,7 @@ import ( "github.com/jippi/dottie/pkg/test_helpers" ) -func TestCommand(t *testing.T) { +func TestEnableCommand(t *testing.T) { t.Parallel() test_helpers.RunFileBasedCommandTests(t, 0, "enable") diff --git a/cmd/enable/tests/enable-a-key/stderr.golden b/cmd/enable/tests/enable-a-key/stderr.golden index fec5fa2..6915875 100644 --- a/cmd/enable/tests/enable-a-key/stderr.golden +++ b/cmd/enable/tests/enable-a-key/stderr.golden @@ -1 +1,2 @@ ---- exec command line 0: [enable KEY_B] +(no output to stderr) diff --git a/cmd/enable/tests/invalid-key/stdout.golden b/cmd/enable/tests/invalid-key/stdout.golden index 5dc11c0..f53d6f0 100644 --- a/cmd/enable/tests/invalid-key/stdout.golden +++ b/cmd/enable/tests/invalid-key/stdout.golden @@ -1 +1,2 @@ ---- exec command line 0: [enable NONEXISTING_KEY] +(no output to stdout) diff --git a/cmd/enable/tests/missing-key/stdout.golden b/cmd/enable/tests/missing-key/stdout.golden index e66e7b4..0a0fea8 100644 --- a/cmd/enable/tests/missing-key/stdout.golden +++ b/cmd/enable/tests/missing-key/stdout.golden @@ -1 +1,2 @@ ---- exec command line 0: [enable] +(no output to stdout) diff --git a/cmd/groups/groups_test.go b/cmd/groups/groups_test.go index 8f8288b..8291f96 100644 --- a/cmd/groups/groups_test.go +++ b/cmd/groups/groups_test.go @@ -6,8 +6,8 @@ import ( "github.com/jippi/dottie/pkg/test_helpers" ) -func TestCommand(t *testing.T) { +func TestGroupsCommand(t *testing.T) { t.Parallel() - test_helpers.RunFileBasedCommandTests(t, test_helpers.SkipEnvCopy, "groups") + test_helpers.RunFileBasedCommandTests(t, test_helpers.ReadOnly, "groups") } diff --git a/cmd/groups/tests/multiple-groups/stderr.golden b/cmd/groups/tests/multiple-groups/stderr.golden index 94cc795..a4fd48d 100644 --- a/cmd/groups/tests/multiple-groups/stderr.golden +++ b/cmd/groups/tests/multiple-groups/stderr.golden @@ -1 +1,2 @@ ---- exec command line 0: [groups] +(no output to stderr) diff --git a/cmd/groups/tests/no-groups/stdout.golden b/cmd/groups/tests/no-groups/stdout.golden index 94cc795..ec6a993 100644 --- a/cmd/groups/tests/no-groups/stdout.golden +++ b/cmd/groups/tests/no-groups/stdout.golden @@ -1 +1,2 @@ ---- exec command line 0: [groups] +(no output to stdout) diff --git a/cmd/groups/tests/single-group/stderr.golden b/cmd/groups/tests/single-group/stderr.golden index 94cc795..a4fd48d 100644 --- a/cmd/groups/tests/single-group/stderr.golden +++ b/cmd/groups/tests/single-group/stderr.golden @@ -1 +1,2 @@ ---- exec command line 0: [groups] +(no output to stderr) diff --git a/cmd/print/print_test.go b/cmd/print/print_test.go index f02b771..6ccc9af 100644 --- a/cmd/print/print_test.go +++ b/cmd/print/print_test.go @@ -6,8 +6,8 @@ import ( "github.com/jippi/dottie/pkg/test_helpers" ) -func TestCommand(t *testing.T) { +func TestPrintCommand(t *testing.T) { t.Parallel() - test_helpers.RunFileBasedCommandTests(t, test_helpers.SkipEnvCopy, "print") + test_helpers.RunFileBasedCommandTests(t, test_helpers.ReadOnly, "print") } diff --git a/cmd/print/tests/empty/stderr.golden b/cmd/print/tests/empty/stderr.golden index a1e5768..069fc9c 100644 --- a/cmd/print/tests/empty/stderr.golden +++ b/cmd/print/tests/empty/stderr.golden @@ -1 +1,2 @@ ---- exec command line 0: [print --no-color] +(no output to stderr) diff --git a/cmd/print/tests/full/stderr.golden b/cmd/print/tests/full/stderr.golden index cb65407..22e39bb 100644 --- a/cmd/print/tests/full/stderr.golden +++ b/cmd/print/tests/full/stderr.golden @@ -1 +1,2 @@ ---- exec command line 0: [print --no-color --pretty] +(no output to stderr) diff --git a/cmd/print/tests/simple-pretty/stderr.golden b/cmd/print/tests/simple-pretty/stderr.golden index cb65407..22e39bb 100644 --- a/cmd/print/tests/simple-pretty/stderr.golden +++ b/cmd/print/tests/simple-pretty/stderr.golden @@ -1 +1,2 @@ ---- exec command line 0: [print --no-color --pretty] +(no output to stderr) diff --git a/cmd/print/tests/simple/stderr.golden b/cmd/print/tests/simple/stderr.golden index a1e5768..069fc9c 100644 --- a/cmd/print/tests/simple/stderr.golden +++ b/cmd/print/tests/simple/stderr.golden @@ -1 +1,2 @@ ---- exec command line 0: [print --no-color] +(no output to stderr) diff --git a/cmd/print/tests/specific-group/stderr.golden b/cmd/print/tests/specific-group/stderr.golden index 8e61f95..a034bd6 100644 --- a/cmd/print/tests/specific-group/stderr.golden +++ b/cmd/print/tests/specific-group/stderr.golden @@ -1 +1,2 @@ ---- exec command line 0: [print --no-color --group my-first-group] +(no output to stderr) diff --git a/cmd/set/set.go b/cmd/set/set.go index f73ea23..ccca723 100644 --- a/cmd/set/set.go +++ b/cmd/set/set.go @@ -1,7 +1,6 @@ package set import ( - "errors" "fmt" "strings" @@ -34,6 +33,9 @@ func NewCommand() *cobra.Command { cmd.Flags().Bool("disabled", false, "Set/change the flag to be disabled (commented out)") cmd.Flags().Bool("error-if-missing", false, "Exit with an error if the KEY does not exists in the .env file already") + cmd.Flags().Bool("skip-if-exists", false, "If the already KEY exists, do not set or change any settings") + cmd.Flags().Bool("skip-if-same", false, "If the already KEY exists, and it the value is identical, do not set or change any settings") + cmd.Flags().String("group", "", "The (optional) group name to add the KEY=VALUE pair under") cmd.Flags().String("before", "", "If the key doesn't exist, add it to the file *before* this KEY") cmd.Flags().String("after", "", "If the key doesn't exist, add it to the file *after* this KEY") @@ -61,6 +63,8 @@ func runE(cmd *cobra.Command, args []string) error { document, upsert.WithGroup(shared.StringFlag(cmd.Flags(), "group")), upsert.WithSettingIf(upsert.ErrorIfMissing, shared.BoolFlag(cmd.Flags(), "error-if-missing")), + upsert.WithSettingIf(upsert.SkipIfExists, shared.BoolFlag(cmd.Flags(), "skip-if-exists")), + upsert.WithSettingIf(upsert.SkipIfSame, shared.BoolFlag(cmd.Flags(), "skip-if-same")), upsert.WithSettingIf(upsert.UpdateComments, cmd.Flag("comment").Changed), ) if err != nil { @@ -130,7 +134,7 @@ func runE(cmd *cobra.Command, args []string) error { } if allErrors != nil { - return errors.New("validation error") + return fmt.Errorf("validation error: %+w", allErrors) } // diff --git a/cmd/set/set_test.go b/cmd/set/set_test.go index 3a6811a..e86616e 100644 --- a/cmd/set/set_test.go +++ b/cmd/set/set_test.go @@ -6,7 +6,7 @@ import ( "github.com/jippi/dottie/pkg/test_helpers" ) -func TestCommand(t *testing.T) { +func TestSetCommand(t *testing.T) { t.Parallel() test_helpers.RunFileBasedCommandTests(t, 0, "set") diff --git a/cmd/set/tests/error-if-missing.env b/cmd/set/tests/error-if-missing.env new file mode 100644 index 0000000..8afe00b --- /dev/null +++ b/cmd/set/tests/error-if-missing.env @@ -0,0 +1 @@ +SOME_KEY="ERROR THE VALUE WAS NOT CHANGED" diff --git a/cmd/set/tests/error-if-missing.run b/cmd/set/tests/error-if-missing.run new file mode 100644 index 0000000..de23a8b --- /dev/null +++ b/cmd/set/tests/error-if-missing.run @@ -0,0 +1,2 @@ +--error-if-missing MISSING_KEY="THIS MUST FAIL" +--error-if-missing SOME_KEY="SUCCESS" diff --git a/cmd/set/tests/error-if-missing/env.golden b/cmd/set/tests/error-if-missing/env.golden new file mode 100644 index 0000000..1a7fe8f --- /dev/null +++ b/cmd/set/tests/error-if-missing/env.golden @@ -0,0 +1 @@ +SOME_KEY="SUCCESS" diff --git a/cmd/set/tests/error-if-missing/stderr.golden b/cmd/set/tests/error-if-missing/stderr.golden new file mode 100644 index 0000000..ac6afd4 --- /dev/null +++ b/cmd/set/tests/error-if-missing/stderr.golden @@ -0,0 +1,7 @@ +---- exec command line 0: [set --error-if-missing MISSING_KEY=THIS MUST FAIL] +(error *errors.errorString) key [MISSING_KEY] does not exists in the document + +Error: validation error: key [MISSING_KEY] does not exists in the document +Run 'dottie set --help' for usage. +---- exec command line 1: [set --error-if-missing SOME_KEY=SUCCESS] +(no output to stderr) diff --git a/cmd/set/tests/error-if-missing/stdout.golden b/cmd/set/tests/error-if-missing/stdout.golden new file mode 100644 index 0000000..1216cda --- /dev/null +++ b/cmd/set/tests/error-if-missing/stdout.golden @@ -0,0 +1,5 @@ +---- exec command line 0: [set --error-if-missing MISSING_KEY=THIS MUST FAIL] +(no output to stdout) +---- exec command line 1: [set --error-if-missing SOME_KEY=SUCCESS] +Key [ SOME_KEY ] was successfully upserted +File was successfully saved diff --git a/cmd/set/tests/manipulate-empty.env b/cmd/set/tests/manipulate-empty.env deleted file mode 100644 index dfd1584..0000000 --- a/cmd/set/tests/manipulate-empty.env +++ /dev/null @@ -1 +0,0 @@ -SOME_KEY="SOME_VALUE" diff --git a/cmd/set/tests/manipulate-empty/stderr.golden b/cmd/set/tests/manipulate-empty/stderr.golden index c3a6913..9ddd180 100644 --- a/cmd/set/tests/manipulate-empty/stderr.golden +++ b/cmd/set/tests/manipulate-empty/stderr.golden @@ -1,14 +1,22 @@ ---- exec command line 0: [set SOME_KEY=SOME_VALUE] +(no output to stderr) ---- exec command line 1: [set ANOTHER_KEY=ANOTHER_VALUE --quote-style single] +(no output to stderr) ---- exec command line 2: [set SECOND_KEY=should be before ANOTHER_KEY --before ANOTHER_KEY] +(no output to stderr) ---- exec command line 3: [set TRUE_SECOND_KEY=HA, I'm after SOME_KEY, so I'm before ANOTHER_KEY now --after SOME_KEY] +(no output to stderr) ---- exec command line 4: [set SECOND_KEY=damn, I'm the third key now] +(no output to stderr) ---- exec command line 5: [set SOME_KEY=ANOTHER_VALUE --comment I'm a comment --comment I'm another comment] +(no output to stderr) ---- exec command line 6: [set A_NUMBER=1 --comment @dottie/validate number] +(no output to stderr) ---- exec command line 7: [set NOT_A_NUMBER=abc --comment @dottie/validate number] NOT_A_NUMBER (-:2) * (number) The value [abc] is not a valid number. -Error: validation error +Error: validation error: Key: 'NOT_A_NUMBER' Error:Field validation for 'NOT_A_NUMBER' failed on the 'number' tag Run 'dottie set --help' for usage. ---- exec command line 8: [set A_NUMBER=2] +(no output to stderr) diff --git a/cmd/set/tests/manipulate-empty/stdout.golden b/cmd/set/tests/manipulate-empty/stdout.golden index a4b6ec0..b9c0e55 100644 --- a/cmd/set/tests/manipulate-empty/stdout.golden +++ b/cmd/set/tests/manipulate-empty/stdout.golden @@ -20,6 +20,7 @@ File was successfully saved Key [ A_NUMBER ] was successfully upserted File was successfully saved ---- exec command line 7: [set NOT_A_NUMBER=abc --comment @dottie/validate number] +(no output to stdout) ---- exec command line 8: [set A_NUMBER=2] Key [ A_NUMBER ] was successfully upserted File was successfully saved diff --git a/cmd/set/tests/skip-if-exists.run b/cmd/set/tests/skip-if-exists.run new file mode 100644 index 0000000..0eb9aff --- /dev/null +++ b/cmd/set/tests/skip-if-exists.run @@ -0,0 +1,2 @@ +--skip-if-exists SOME_KEY="SUCCESS" +--skip-if-exists SOME_KEY="ERROR; THE VALUE MUST NOT CHANGE" diff --git a/cmd/set/tests/skip-if-exists/env.golden b/cmd/set/tests/skip-if-exists/env.golden new file mode 100644 index 0000000..1a7fe8f --- /dev/null +++ b/cmd/set/tests/skip-if-exists/env.golden @@ -0,0 +1 @@ +SOME_KEY="SUCCESS" diff --git a/cmd/set/tests/skip-if-exists/stderr.golden b/cmd/set/tests/skip-if-exists/stderr.golden new file mode 100644 index 0000000..a9afcd8 --- /dev/null +++ b/cmd/set/tests/skip-if-exists/stderr.golden @@ -0,0 +1,4 @@ +---- exec command line 0: [set --skip-if-exists SOME_KEY=SUCCESS] +(no output to stderr) +---- exec command line 1: [set --skip-if-exists SOME_KEY=ERROR; THE VALUE MUST NOT CHANGE] +(no output to stderr) diff --git a/cmd/set/tests/skip-if-exists/stdout.golden b/cmd/set/tests/skip-if-exists/stdout.golden new file mode 100644 index 0000000..afa258a --- /dev/null +++ b/cmd/set/tests/skip-if-exists/stdout.golden @@ -0,0 +1,6 @@ +---- exec command line 0: [set --skip-if-exists SOME_KEY=SUCCESS] +Key [ SOME_KEY ] was successfully upserted +File was successfully saved +---- exec command line 1: [set --skip-if-exists SOME_KEY=ERROR; THE VALUE MUST NOT CHANGE] +Key [ SOME_KEY ] was successfully upserted +File was successfully saved diff --git a/cmd/set/tests/skip-if-same.run b/cmd/set/tests/skip-if-same.run new file mode 100644 index 0000000..c22d1b0 --- /dev/null +++ b/cmd/set/tests/skip-if-same.run @@ -0,0 +1,2 @@ +--skip-if-same SOME_KEY="ERROR THIS SHOULD BE CHANGED BY NEXT LINE" +--skip-if-same SOME_KEY="SUCCESS" diff --git a/cmd/set/tests/skip-if-same/env.golden b/cmd/set/tests/skip-if-same/env.golden new file mode 100644 index 0000000..1a7fe8f --- /dev/null +++ b/cmd/set/tests/skip-if-same/env.golden @@ -0,0 +1 @@ +SOME_KEY="SUCCESS" diff --git a/cmd/set/tests/skip-if-same/stderr.golden b/cmd/set/tests/skip-if-same/stderr.golden new file mode 100644 index 0000000..486b3a8 --- /dev/null +++ b/cmd/set/tests/skip-if-same/stderr.golden @@ -0,0 +1,4 @@ +---- exec command line 0: [set --skip-if-same SOME_KEY=ERROR THIS SHOULD BE CHANGED BY NEXT LINE] +(no output to stderr) +---- exec command line 1: [set --skip-if-same SOME_KEY=SUCCESS] +(no output to stderr) diff --git a/cmd/set/tests/skip-if-same/stdout.golden b/cmd/set/tests/skip-if-same/stdout.golden new file mode 100644 index 0000000..a1b27e3 --- /dev/null +++ b/cmd/set/tests/skip-if-same/stdout.golden @@ -0,0 +1,6 @@ +---- exec command line 0: [set --skip-if-same SOME_KEY=ERROR THIS SHOULD BE CHANGED BY NEXT LINE] +Key [ SOME_KEY ] was successfully upserted +File was successfully saved +---- exec command line 1: [set --skip-if-same SOME_KEY=SUCCESS] +Key [ SOME_KEY ] was successfully upserted +File was successfully saved diff --git a/pkg/ast/upsert/upsert.go b/pkg/ast/upsert/upsert.go index 27ea1cc..66bd621 100644 --- a/pkg/ast/upsert/upsert.go +++ b/pkg/ast/upsert/upsert.go @@ -53,29 +53,29 @@ func (u *Upserter) ApplyOptions(options ...Option) error { // Upsert will, depending on its options, either Update or Insert (thus, "[Up]date + In[sert]"). func (u *Upserter) Upsert(ctx context.Context, input *ast.Assignment) (*ast.Assignment, error, error) { assignment := u.document.Get(input.Name) - found := assignment != nil + exists := assignment != nil // Short circuit with some quick settings checks switch { // The assignment exists, so return early - case found && u.settings.Has(SkipIfExists): + case exists && u.settings.Has(SkipIfExists): return nil, nil, nil + // The assignment does *NOT* exists, and we require it to + case !exists && u.settings.Has(ErrorIfMissing): + return nil, nil, fmt.Errorf("key [%s] does not exists in the document", input.Name) + // The assignment exists, has a literal value, and the literal value isn't what we should consider empty - case found && u.settings.Has(SkipIfSet) && len(assignment.Literal) > 0 && !slices.Contains(u.valuesConsideredEmpty, assignment.Literal): + case exists && u.settings.Has(SkipIfSet) && len(assignment.Literal) > 0 && !slices.Contains(u.valuesConsideredEmpty, assignment.Literal): return nil, nil, nil // The assignment exists, the literal values are the same, and they have same 'Enabled' level - case found && u.settings.Has(SkipIfSame) && assignment.Literal == input.Literal && assignment.Enabled == input.Enabled: + case exists && u.settings.Has(SkipIfSame) && assignment.Literal == input.Literal && assignment.Enabled == input.Enabled: return nil, nil, nil - // The assignment does *NOT* exists, and we require it to - case !found && u.settings.Has(ErrorIfMissing): - return nil, nil, fmt.Errorf("key [%s] does not exists in the document", input.Name) - // The KEY was *NOT* found, and all other preconditions are not triggering - case !found: + case !exists: var err error // Create and insert the (*ast.Assignment) into the Statement list diff --git a/pkg/test_helpers/filebased_command_tests.go b/pkg/test_helpers/filebased_command_tests.go index cac3dd6..4470c5a 100644 --- a/pkg/test_helpers/filebased_command_tests.go +++ b/pkg/test_helpers/filebased_command_tests.go @@ -3,6 +3,7 @@ package test_helpers import ( "bytes" "context" + "errors" "fmt" "io" "os" @@ -21,7 +22,7 @@ import ( type Setting int const ( - SkipEnvCopy Setting = 1 << iota + ReadOnly Setting = 1 << iota ) // Has checks if [check] exists in the [settings] bitmask or not. @@ -118,18 +119,23 @@ func RunFileBasedCommandTests(t *testing.T, settings Setting, globalArgs ...stri dotEnvFile := "tests/" + tt.envFile - if !settings.Has(SkipEnvCopy) { - tmpDir := t.TempDir() - dotEnvFile = tmpDir + "/tmp.env" - - // Copy the input.env to temporary place - err := copyFile(t, "tests/"+tt.envFile, tmpDir+"/tmp.env") - require.NoErrorf(t, err, "failed to copy [%s] to TempDir", tt.envFile) + if !settings.Has(ReadOnly) { + dotEnvFile = t.TempDir() + "/tmp.env" + + if _, err := os.Stat("tests/" + tt.envFile); errors.Is(err, os.ErrNotExist) { + // Create a temporary empty .env file + _, err := os.Create(dotEnvFile) + require.NoErrorf(t, err, "failed to create empty .env file [ %s ] in TempDir", tt.envFile) + } else { + // Copy the input.env to temporary place + err := copyFile(t, "tests/"+tt.envFile, dotEnvFile) + require.NoErrorf(t, err, "failed to copy [ %s ] to TempDir", tt.envFile) + } } // Prepare output buffers - stdout := bytes.Buffer{} - stderr := bytes.Buffer{} + combinedStdout := bytes.Buffer{} + combinedStderr := bytes.Buffer{} ctx := context.Background() @@ -139,23 +145,36 @@ func RunFileBasedCommandTests(t *testing.T, settings Setting, globalArgs ...stri args = append(args, globalArgs...) args = append(args, command...) - stdout.WriteString(fmt.Sprintf("---- exec command line %d: %+v\n", idx, args)) - stderr.WriteString(fmt.Sprintf("---- exec command line %d: %+v\n", idx, args)) + combinedStdout.WriteString(fmt.Sprintf("---- exec command line %d: %+v\n", idx, args)) + combinedStderr.WriteString(fmt.Sprintf("---- exec command line %d: %+v\n", idx, args)) commandArgs := append(args, "--file", dotEnvFile) // Run command + stdout := bytes.Buffer{} + stderr := bytes.Buffer{} out, _ := cmd.RunCommand(ctx, commandArgs, &stdout, &stderr) + if stdout.Len() == 0 { + stdout.WriteString("(no output to stdout)\n") + } + + if stderr.Len() == 0 { + stderr.WriteString("(no output to stderr)\n") + } + + stdout.WriteTo(&combinedStdout) + stderr.WriteTo(&combinedStderr) + // Assert we got a Cobra command back require.NotNil(t, out, "expected a return value") } // Assert stdout + stderr + modified env file is as expected - golden.Assert(t, tt.goldenStdout, stdout.Bytes()) - golden.Assert(t, tt.goldenStderr, stderr.Bytes()) + golden.Assert(t, tt.goldenStdout, combinedStdout.Bytes()) + golden.Assert(t, tt.goldenStderr, combinedStderr.Bytes()) - if !settings.Has(SkipEnvCopy) { + if !settings.Has(ReadOnly) { // Read the modified .env file back modifiedEnv, err := os.ReadFile(dotEnvFile)