Skip to content

refactor(internal): move LoadEnvFile, FindOpsfileDir, and OpsFileName into internal package#49

Merged
seanseannery merged 1 commit intomainfrom
refactor/move-core-logic-to-internal
Mar 19, 2026
Merged

refactor(internal): move LoadEnvFile, FindOpsfileDir, and OpsFileName into internal package#49
seanseannery merged 1 commit intomainfrom
refactor/move-core-logic-to-internal

Conversation

@seanseannery
Copy link
Copy Markdown
Owner

Key Changes

  • LoadEnvFile + DefaultEnvFileName moved from cmd/ops/main.gointernal/envfile_parser.go — env file resolution belongs alongside env file parsing
  • FindOpsfileDir + OpsFileName moved from cmd/ops/main.gointernal/opsfile_parser.go — Opsfile discovery belongs alongside Opsfile parsing
  • cmd/ops/main.go is now a thin wiring layer with no domain logic of its own
  • cmd/ops/main_test.go deleted — tests migrated to their respective internal test files

Why do we need this?

Continues the encapsulation work from #48. main.go was still hosting domain logic (file discovery, env file loading) that belongs in internal. Moving these makes internal fully self-contained and main.go a pure entry point.

New modules or other dependencies introduced

None.

How was this tested?

  • TestLoadEnvFile_* (5 cases) added to internal/envfile_parser_test.go
  • TestFindOpsfileDir_* (4 cases) migrated from cmd/ops/main_test.go to internal/opsfile_parser_test.go
  • make lint and make test pass

… 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.
@seanseannery seanseannery merged commit 2b0e351 into main Mar 19, 2026
4 checks passed
@seanseannery seanseannery deleted the refactor/move-core-logic-to-internal branch March 19, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant