Skip to content

typo in Effective Go means code example does not compile #218

@gopherbot

Description

@gopherbot

by michael.elkins:

In the "Effective Go" document in the section describing the "switch"
command, the following code excerpt is used:

switch t := interfaceValue.(type) {
default:
    fmt.Printf("unexpected type %T", type);  // %T prints type

This code does not compile.  I believe that last line should be:

    fmt.Printf("unexpected type %T", t);  // %T prints type

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions