Skip to content
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

Change YAMLToJSON to ToJSON, JSONToYAML to FromJSON #556

Closed

Conversation

alexandear
Copy link

The PR proposes renaming the functions YAMLToJSON to ToJSON, and JSONToYAML to FromJSON to avoid redundancies on the client side. For example, yaml.ToJSON, yaml.FromJSON are much simpler to use than yaml.YAMLToJSON, yaml.JSONToYAML.

This is suggested by the revive.exported rule:

yaml.go:252:6: exported: func name will be used as yaml.YAMLToJSON by other packages, and that stutters; consider calling this ToJSON (revive)
func YAMLToJSON(bytes []byte) ([]byte, error) {
     ^

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.01%. Comparing base (01f4bac) to head (e54a0b1).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #556      +/-   ##
==========================================
+ Coverage   77.00%   77.01%   +0.01%     
==========================================
  Files          21       21              
  Lines        7270     7274       +4     
==========================================
+ Hits         5598     5602       +4     
  Misses       1277     1277              
  Partials      395      395              

@goccy
Copy link
Owner

goccy commented Nov 29, 2024

Thank you for your contribution ! But For now, I don't have any plans to change these names.

@goccy goccy closed this Nov 29, 2024
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.

3 participants