campeon23 / split-fetcher

The code is a concurrent file downloader in Go that splits a file into multiple parts, downloads them in parallel, and assembles the final file, with support for Etag validation to ensure file integrity.
MIT License
1 stars 0 forks source link

Handle Missing pprof Config File for Development Mode #129

Closed campeon23 closed 1 year ago

campeon23 commented 1 year ago

Issue:

Steps to Reproduce:

Actual Behavior:

Suggested Fix:

Affected packages:

Affected Functions/Variables:

Init() var rootCmd = &cobra.Command{}

Steps to Implement Fix:

Reviewer: Marco A. Villarruel

Priority: Medium

campeon23 commented 1 year ago

Issue Resolved!

Implemented the suggested fix as outlined:

Modified the rootCmd = &cobra.Command{} variable in the main.go package. Introduced a conditional check in the Init() function. This checks the presence of the pprof config file and the state of the ENV_MODE environment variable. When ENV_MODE is set to "development" and the pprof config file exists, the configuration is loaded. If the configuration file is absent in "development" mode, an informative log message is now displayed, advising the use of default settings or noting the absence of pprof profiling. Thorough tests were conducted post-fix:

Tested the build process in both "development" and other modes. The system behaves as expected, handling the pprof configuration appropriately. Given the successful implementation and testing, I'm marking this ticket as closed. Should there be any further issues related to this, please feel free to reopen.