Skip to content

Illegal rune litteral in Go example #57

Description

@zeidlitz

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 ✌

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions