Skip to content

Conversation

@nkitlabs
Copy link
Contributor

Fixed: Add init config & test

Implementation details

Please ensure the following requirements are met before submitting a pull request:

  • The pull request is targeted against the correct target branch
  • The pull request is linked to an issue with appropriate discussion and an accepted design OR is linked to a spec that describes the work.
  • The pull request includes a description of the implementation/work done in detail.
  • The pull request includes any and all appropriate unit/integration tests
  • You have added a relevant changelog entry to CHANGELOG_UNRELEASED.md
  • You have re-reviewed the files affected by the pull request (e.g. using the Files changed tab in the Github PR explorer)

falcon/app.go Outdated
Comment on lines 125 to 136
var cfg Config
var err error
switch {
case customFilePath != "":
cfg, err = LoadConfig(customFilePath) // Initialize with CustomConfig if file is provided
if err != nil {
return fmt.Errorf("LoadConfig file %v error %v", customFilePath, err)
}
default:
cfg = DefaultConfig() // Initialize with DefaultConfig if no file is provided
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • move the logic to below os.Create part, so that the code states clearly that first part is about creating a folder/file
  • prefer if/else over switch case

Tanut Lertwarachai added 2 commits October 18, 2024 13:10
@nkitlabs nkitlabs merged commit f654a3c into development Oct 18, 2024
@nkitlabs nkitlabs deleted the feature/init-config branch October 23, 2024 17:30
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.

2 participants