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

feat: Use gg to generate code for pairs #728

Merged
merged 7 commits into from
Sep 3, 2021
Merged

feat: Use gg to generate code for pairs #728

merged 7 commits into from
Sep 3, 2021

Conversation

Xuanwo
Copy link
Contributor

@Xuanwo Xuanwo commented Aug 27, 2021

This is a demo PR for evaluations.

Related to #607.

  • Is go-codegen more friendly than go template?
  • Is go-codegen easier to learn/use/understanding?

@codecov
Copy link

codecov bot commented Aug 27, 2021

Codecov Report

Merging #728 (42a3ab9) into master (ff8dbd1) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #728   +/-   ##
=======================================
  Coverage   12.47%   12.47%           
=======================================
  Files          22       22           
  Lines        1483     1483           
=======================================
  Hits          185      185           
  Misses       1291     1291           
  Partials        7        7           
Flag Coverage Δ
unittests 12.47% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff8dbd1...42a3ab9. Read the comment docs.

Signed-off-by: Xuanwo <[email protected]>
@Xuanwo
Copy link
Contributor Author

Xuanwo commented Sep 1, 2021

ping @JinnyYi to take another look.

@Xuanwo
Copy link
Contributor Author

Xuanwo commented Sep 1, 2021

I will extend it to more complex functions like operations tomorrow.

Signed-off-by: Xuanwo <[email protected]>
@Xuanwo
Copy link
Contributor Author

Xuanwo commented Sep 2, 2021

I re-design the API of codegen that inspired by jen, please take a look.

The code can't be compiled so fat, I will implement it if it looks good.

@JinnyYi
Copy link
Contributor

JinnyYi commented Sep 2, 2021

I re-design the API of codegen that inspired by jen, please take a look.

I think it‘s easy to read and translate into the final generated code.

@Xuanwo Xuanwo changed the title feat: Use go-codegen to generate code for pairs feat: Use gg to generate code for pairs Sep 3, 2021
@Xuanwo
Copy link
Contributor Author

Xuanwo commented Sep 3, 2021

ping @JinnyYi for review.

@JinnyYi
Copy link
Contributor

JinnyYi commented Sep 3, 2021

LGTM. Only a small doubt, is it possible or necessary to keep only Description for Pair?

@Xuanwo
Copy link
Contributor Author

Xuanwo commented Sep 3, 2021

LGTM. Only a small doubt, is it possible or necessary to keep only Description for Pair?

Yes, we have to. We use originalDescription here because we need to make sure the remaining templates works. We will remove originalDescription finally!

@Xuanwo
Copy link
Contributor Author

Xuanwo commented Sep 3, 2021

I will bump a version about gg, please merge this PR after update, thanks!

Copy link
Contributor

@JinnyYi JinnyYi left a comment

Choose a reason for hiding this comment

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

LGTM.

@JinnyYi JinnyYi merged commit 3cdcd3f into master Sep 3, 2021
@JinnyYi JinnyYi deleted the codegen-demo branch September 3, 2021 02:50
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