gocode icon indicating copy to clipboard operation
gocode copied to clipboard

Missing second variable in select statements.

Open nsf opened this issue 8 years ago • 2 comments

package main

import "time"

func test() {
	t := time.NewTicker(time.Second)
	select {
	case foo, ok := <-t.C:
		#
	}
}

"ok" is not visible there. I consider it as low priority, because "ok" is always a boolean and has no members, so the chance that you actually need autocompletion for it is low. But might worth fixing it one day. Gocode has mechanisms for infering such types with a map indexing statement. Shouldn't be too hard to add this one as well.

nsf avatar Feb 26 '17 11:02 nsf

@nsf I tried also https://github.com/nsf/gocode/commit/77f5eaf94d9ac800c1683b63484a459c63a80ec7, but yeah doesn't visible ok. so give up. But understand you opinion.

BTW, sorry nit:

	select {
	case foo, ok := <-t.C: # it's token.DEFINE
		#
	}

zchee avatar Feb 26 '17 12:02 zchee

Fixed.

nsf avatar Feb 26 '17 12:02 nsf