Skip to content

Strings cannot be nil #2144

Open
Open
@dlsniper

Description

@dlsniper
package demo

func _() {
    var x string = nil // cannot use nil as type string in assignment

    if x == nil { // invalid operation: x == nil (mismatched types string and nil)
        x = "default"
    }
}

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