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: fix trimmer quote issue #221

Merged
merged 3 commits into from
Aug 2, 2024

Conversation

HeyJavaBean
Copy link
Member

@HeyJavaBean HeyJavaBean commented Aug 2, 2024

Description

In previous implement, trimmer idl dump had some quote issue,for example:

struct HeyHello {
    1: required string styleA(go.tag = "json:'id'")
    2: required string styleB(go.tag = "json:\"id\"")
    3: required string styleC(go.tag = 'json:"id"')
    4: required string styleD(go.tag = 'json:\"id\"')
}

after trimmer dump, it looks like this:

struct HeyHello {
    1: required string styleA(go.tag = "json:'id'")
    2: required string styleB(go.tag = "json:\"id\"")
    3: required string styleC(go.tag = "json:\"id\"")
    4: required string styleD(go.tag = "json:\\"id\\"")
} 

For styleC and styleD (which use the ' ), the output results are wrong.


After this fix pr, the output is like this:

struct HeyHello {
    1: required string styleA(go.tag = "json:'id'")
    2: required string styleB(go.tag = "json:\"id\"")
    3: required string styleC(go.tag = "json:\"id\"")
    4: required string styleD(go.tag = "json:\"id\"")
} 

The output results are all using the same form, starting with ", and use " for the escape string.

Motivation and Context

Related Issue

@HeyJavaBean HeyJavaBean requested review from a team as code owners August 2, 2024 09:31
@HeyJavaBean HeyJavaBean changed the title Fix/fix trimmer quote issue fix: fix trimmer quote issue Aug 2, 2024
@HeyJavaBean HeyJavaBean merged commit 62b7d1c into cloudwego:main Aug 2, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants