Skip to content

Omitted variadic function parameter should be nil #806

Closed
@bzub

Description

@bzub

Example

func(s ...string) {
    if s == nil {
        fmt.Println("s is nil")
    }
}()

With Go compiler s == nil (playground)
With GopherJS s != nil (playground)

Spec

https://golang.org/ref/spec#Passing_arguments_to_..._parameters

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