-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: init command build empty config file #108
Conversation
types/config/config.go
Outdated
@@ -49,7 +50,7 @@ func DefaultConfig() Config { | |||
} | |||
|
|||
func (c Config) GetBytes() ([]byte, error) { | |||
return c.bytes, nil | |||
return yaml.Marshal(c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break everything when using the GetBytes
method on other projects. Instead, we should fix the initialization inside the DefaultConfig
if the problem is there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated it.
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺ v ✰ Thanks for creating a PR! ✰ v Before smashing the submit button please review the checkboxes. v If a checkbox is n/a - please still include it but + a little note why ☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --> ## Description <!-- Small description --> This PR intends to fix the init command building empty config instead of the default config since `bytes` value of `DefaultConfig` built by constructor is `nil`. ## Checklist - [x] Targeted PR against correct branch. - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [ ] Wrote unit tests. - [x] Re-reviewed `Files changed` in the Github PR explorer.
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺ v ✰ Thanks for creating a PR! ✰ v Before smashing the submit button please review the checkboxes. v If a checkbox is n/a - please still include it but + a little note why ☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --> ## Description <!-- Small description --> This PR intends to fix the init command building empty config instead of the default config since `bytes` value of `DefaultConfig` built by constructor is `nil`. ## Checklist - [x] Targeted PR against correct branch. - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [ ] Wrote unit tests. - [x] Re-reviewed `Files changed` in the Github PR explorer.
Description
This PR intends to fix the init command building empty config instead of the default config since
bytes
value ofDefaultConfig
built by constructor isnil
.Checklist
Files changed
in the Github PR explorer.