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

go/format: unable to write '' in a comment as it's unconditionally transformed to a ” "smart quote" #56380

Closed
arp242 opened this issue Oct 22, 2022 · 2 comments

Comments

@arp242
Copy link

arp242 commented Oct 22, 2022

Since Go 1.19 (commit ae3d890) '' is unconditionally transformed to or . This means my comment:

// lexMultilineRawString consumes a raw string. Nothing can be escaped in such
// a string. It assumes that the beginning ''' has already been consumed and
// ignored.

Now becomes:

// lexMultilineRawString consumes a raw string. Nothing can be escaped in such
// a string. It assumes that the beginning ”' has already been consumed and
// ignored.

There are some other cases, especially when parsing things, where one might reasonably want to type '' inside a regular (non-codeblock) comment.

Looking at go/doc/comment/parse.go, there is no way to escape this behaviour, and I don't really see an obvious non-ugly way to write that comment.

@ALTree
Copy link
Member

ALTree commented Oct 22, 2022

I believe this is already tracked at #54312. I suggest we keep all the discussion about the '' replacement issue in that thread. Closing here.

@arp242
Copy link
Author

arp242 commented Oct 22, 2022

Cheers, I tried searching for an existing issue but I couldn't find it.

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

No branches or pull requests

2 participants