Files
ctrld/cmd/cli
Cuong Manh Le 8b605da861 refactor: convert rootCmd from global to local variable
- Add appVersion variable to store curVersion() result during init
- Change initCLI() to return *cobra.Command
- Move rootCmd creation inside initCLI() as local variable
- Replace all rootCmd.Version usage with appVersion variable
- Update Main() function to capture returned rootCmd from initCLI()
- Remove sync.Once guard from tests and use initCLI() directly
- Remove sync import from test file as it's no longer needed

This refactoring improves encapsulation by eliminating global state,
reduces version computation overhead, and simplifies test setup by
removing the need for sync.Once guards. All tests pass and the
application builds successfully.
2025-10-09 17:49:21 +07:00
..
2025-10-09 17:49:21 +07:00
2025-01-31 20:04:03 +07:00
2025-10-09 16:47:51 +07:00
2025-10-09 17:49:21 +07:00
2023-11-06 20:01:03 +07:00
2025-10-09 17:49:21 +07:00