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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

yawnak
Copy link

@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
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.76%. Comparing base (e2dc75e) to head (6feb9e8).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1328      +/-   ##
==========================================
+ Coverage   72.74%   72.76%   +0.01%     
==========================================
  Files         190      190              
  Lines       13096    13096              
==========================================
+ Hits         9527     9529       +2     
+ Misses       3017     3016       -1     
+ Partials      552      551       -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.

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