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

fix: issue 1327 during code generation #1328

Merged
merged 3 commits into from
Oct 16, 2024
Merged

Conversation

yawnak
Copy link
Contributor

@yawnak yawnak commented Oct 12, 2024

add semicolon to template response encode. This fixes my issue during code generation

Copy link
Member

@tdakkota tdakkota left a comment

Choose a reason for hiding this comment

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

Let's fix it here instead:

{{- if or ($t.NilSemantic.Invalid) ($t.NilSemantic.Optional) -}}

 {{/* Encode value that implements jx.Encoder with respect to nil semantic */}}
 {{- define "json/enc_value" -}}
 {{- $t := $.Type -}}
-{{- if or ($t.NilSemantic.Invalid) ($t.NilSemantic.Optional) -}}
+{{- if or ($t.NilSemantic.Invalid) ($t.NilSemantic.Optional) }}
        if {{ $.Var }} != nil {
                {{- template "json/enc_field" $ }}
                {{ $.Var }}.Encode(e)

@yawnak
Copy link
Contributor Author

yawnak commented Oct 12, 2024

Sure

Copy link

codecov bot commented Oct 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.71%. Comparing base (887f69a) to head (d6350da).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1328      +/-   ##
==========================================
- Coverage   72.73%   72.71%   -0.02%     
==========================================
  Files         190      190              
  Lines       13101    13101              
==========================================
- Hits         9529     9527       -2     
- Misses       3021     3022       +1     
- Partials      551      552       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@tdakkota tdakkota left a comment

Choose a reason for hiding this comment

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

It seems like our commit linter is not happy about refac: instead of refactor:. Could you change your commit message, please?

Everything else LGTM.

@yawnak
Copy link
Contributor Author

yawnak commented Oct 15, 2024

Sure, i will get from work and fix it. Thank you!

@yawnak
Copy link
Contributor Author

yawnak commented Oct 16, 2024

Done

@tdakkota tdakkota merged commit 8a51598 into ogen-go:main Oct 16, 2024
13 checks passed
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