refactor(internal): move LoadEnvFile, FindOpsfileDir, and OpsFileName into internal package#49
Merged
seanseannery merged 1 commit intomainfrom Mar 19, 2026
Conversation
… into internal package Moves remaining cmd/ops logic that belongs in internal: LoadEnvFile and DefaultEnvFileName from main.go to envfile_parser.go, FindOpsfileDir and OpsFileName from main.go to opsfile_parser.go. Adds tests for all three in their respective internal test files and deletes the now-empty main_test.go.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Key Changes
LoadEnvFile+DefaultEnvFileNamemoved fromcmd/ops/main.go→internal/envfile_parser.go— env file resolution belongs alongside env file parsingFindOpsfileDir+OpsFileNamemoved fromcmd/ops/main.go→internal/opsfile_parser.go— Opsfile discovery belongs alongside Opsfile parsingcmd/ops/main.gois now a thin wiring layer with no domain logic of its owncmd/ops/main_test.godeleted — tests migrated to their respective internal test filesWhy do we need this?
Continues the encapsulation work from #48.
main.gowas still hosting domain logic (file discovery, env file loading) that belongs ininternal. Moving these makesinternalfully self-contained andmain.goa pure entry point.New modules or other dependencies introduced
None.
How was this tested?
TestLoadEnvFile_*(5 cases) added tointernal/envfile_parser_test.goTestFindOpsfileDir_*(4 cases) migrated fromcmd/ops/main_test.gotointernal/opsfile_parser_test.gomake lintandmake testpass