Function names updated incorrectly when containing `ID`
- Ngôn ngữ chính
- Go
- Star
- 10.8k
- Fork
- 1.3k
- Merge trung bình
- 2 ngày 36 phút
- Pull request đã merge (30 ngày)
- 26
Mô tả
### What happened?
Change to `wordWalker` in `v0.17.55` unexpectedly changed all the `LT`/`EQ` function names if they contained `ID`
For example:
previous version correctly capitalized the `G` and `L` in these: (`v0.17.54`)
```
OwnerIDGt *string `json:"ownerIDGT,omitempty"`
OwnerIDGte *string `json:"ownerIDGTE,omitempty"`
OwnerIDLt *string `json:"ownerIDLT,omitempty"`
OwnerIDLte *string `json:"ownerIDLTE,omitempty"`
```
With the `v0.17.55` version they are lowercased
```
OwnerIdgt *string `json:"ownerIDGT,omitempty"`
OwnerIdgte *string `json:"ownerIDGTE,omitempty"`
OwnerIdlt *string `json:"ownerIDLT,omitempty"`
OwnerIdlte *string `json:"ownerIDLTE,omitempty"
```
This looks to be due to https://github.com/99designs/gqlgen/pull/3302/files
### What did you expect?
Functions correctly capitalized when containing the `ID`
### Minimal graphql.schema and models to reproduce
Adding the following test to `template_test.go:ToGo`:
```
require.Equal(t, "OwnerIDGT", ToGo("OwnerIDGT"))
```
```
Error Trace: /Users/sarahfunkhouser/go/src/github.com/golanglemonade/gqlgen/codegen/templates/templates_test.go:59
Error: Not equal:
expected: "OwnerIDGT"
actual : "OwnerIdgt"
```
### versions
- `go run github.com/99designs/gqlgen version`? v0.17.55
- `go version`? 1.23.2
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.