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

Illegal rune litteral in Go example #57

Open
zeidlitz opened this issue Aug 21, 2024 · 0 comments
Open

Illegal rune litteral in Go example #57

zeidlitz opened this issue Aug 21, 2024 · 0 comments

Comments

@zeidlitz
Copy link

zeidlitz commented Aug 21, 2024

in golang-calls.go on line 17 the error "Illegal rune literal" occurs because in Go, single quotes are used for character (rune) literals, not for strings. However, in your code, you are trying to define a JSON string within single quotes, which Go interprets as a rune literal.

This can easily be adjusted with a set of backticks or double quotes for string literals like so:

data := url.Values{
    "from":        {"+46709751949"},
    "to":          {"+46700000000"},
    "voice_start": {`{"connect":"+461890510"}`},
}

Might be very nitpick but this will make so the code example can compile out of the box ✌

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

1 participant