Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Omitted variadic function parameter should be nil #806

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

Closed
bzub opened this issue Apr 25, 2018 · 1 comment · Fixed by #1096
Closed

Omitted variadic function parameter should be nil #806

bzub opened this issue Apr 25, 2018 · 1 comment · Fixed by #1096

Comments

@bzub
Copy link

bzub commented Apr 25, 2018

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

@myitcv
Copy link
Member

myitcv commented Apr 26, 2018

Hmm I was fairly certain I'd filed and issue for this in the past, @bzub. But I guess I misremembered because I can't find anything.

I've just pushed up #807 to fix this; perhaps you could give it a try:

cd $(go list -f '{{.Dir}}' github.com/gopherjs/gopherjs) && \
git fetch origin pull/807/head && \
git checkout FETCH_HEAD && \
go install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants