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

refactor(renderer): Use string instead of []byte internally … #625

Merged
merged 1 commit into from
Jun 20, 2020

Conversation

gdamore
Copy link
Collaborator

@gdamore gdamore commented Jun 20, 2020

NB: This PR is based upon the PR for 623, as I anticipate that that PR will be merged first.

This internal refactoring is phase 1, and gets rid of the | printf "%s" nonsense in the templates.

I anticipate doing further refactoring of the templates to make them nicer and easier to work with, and easier to modify. (For example removing Contextual Pipeline intermediate object and the need to do with $Data.)

Note that I did not have to modify any of the test code for this -- there are no changes to outputs.

@gdamore
Copy link
Collaborator Author

gdamore commented Jun 20, 2020

I forgot to mark that commit -- integrating this PR will fix #619.

@codecov
Copy link

codecov bot commented Jun 20, 2020

Codecov Report

Merging #625 into master will decrease coverage by 0.00%.
The diff coverage is 71.71%.

@@            Coverage Diff             @@
##           master     #625      +/-   ##
==========================================
- Coverage   86.78%   86.77%   -0.01%     
==========================================
  Files          70       70              
  Lines        4395     4393       -2     
==========================================
- Hits         3814     3812       -2     
  Misses        369      369              
  Partials      212      212              

Copy link
Member

@xcoulon xcoulon left a comment

Choose a reason for hiding this comment

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

Good job @gdamore! thanks for taking care of all this cleanup 🙌
Please rebase the PR and I'll merge it afterwards

This uses strings.Builder to get more efficiency and reduce
copies, but more importantly it gets rid of the need to pipe
output through printf "%s" in templates, which makes them
cleaner and nicer to work with.

Fixes bytesparadise#619
@gdamore
Copy link
Collaborator Author

gdamore commented Jun 20, 2020

Rebased as requested.

@xcoulon xcoulon merged commit 8955d3d into bytesparadise:master Jun 20, 2020
@xcoulon
Copy link
Member

xcoulon commented Jun 20, 2020

thanks @gdamore 🙌

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