Commit 96fc379
committed
Escape constant names in queries
The `any` keyword was introduced in Go 1.18, and can be used in place
of `interface{}`. This was not in the list of reserved keywords, leading
to identifiers using this term in generated code.
Update the logic to escape constant names, and also add `any` to the
list of reserved keywords.
Signed-off-by: Prajwal Nadig <prajwalnadig21@gmail.com>1 parent e209d86 commit 96fc379
5 files changed
Lines changed: 9 additions & 7 deletions
File tree
- internal
- codegen/golang
- endtoend/testdata/any
- pgx
- v4/go
- v5/go
- stdlib/go
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments