Skip to content

Commit

Permalink
Fix regression in JSON struct field name
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechVitek committed Nov 19, 2022
1 parent 7fc199d commit a3331d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions _examples/golang-basics/example.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _examples/golang-basics/example.ridl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ message User
+ go.tag.db = updated_at

message Nickname
- id: uint64
- ID: uint64
+ go.tag.db = id
- nickname: string
+ go.tag.db = nickname
Expand Down
2 changes: 1 addition & 1 deletion struct.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type {{$struct.Name}} struct {
{{- range $_, $field := $struct.Fields -}}
{{- $fieldName := $field.Name | firstLetterToUpper -}}
{{- $customType := "" -}}
{{- $jsonTags := printf "json:%q" ($field.Name | firstLetterToLower) }}
{{- $jsonTags := printf "json:%q" $field.Name }}
{{- $dbTags := "" }}
{{- range $meta := $field.Meta -}}
{{- if exists $meta "go.field.name" -}}
Expand Down

0 comments on commit a3331d6

Please sign in to comment.