profile
viewpoint
Bryan C. Mills bcmills Google Pittsburgh, PA

google/go-cmp 1986

Package for comparing Go values in tests

bcmills/go2go 18

sketches for the Go 2 Type Parameters proposal

bcmills/unsafeslice 11

Reference implementations for golang/go#38203 and golang/go#19367.

bcmills/k8s-mods 5

go.mod files specifying consistent versions of k8s.io dependencies

bcmills/go-experience-reports 1

Experience reports for the Go programming languange (http://golang.org/wiki/ExperienceReports)

bcmills/goissues 1

utility to export golang/go issues to CSV

bcmills/cespare-misc 0

Experiments and bad ideas

bcmills/extra-keyboards-for-chrome-os 0

Extra keyboard layouts and input methods for Chrome OS

bcmills/go-misc 0

Miscellaneous Go hacks

bcmills/issue29268 0

example repository for golang.org/issue/29268

issue openedgolang/go

database/sql: failures in TestTxStmtDeadlock starting Oct. 28

--- FAIL: TestTxStmtDeadlock (0.01s)
    sql_test.go:2835: unexpected error while executing stmt, err: sql: statement is closed
FAIL
FAIL	database/sql	0.624s

Possibly due to CL 250178 (@tz70s, @odeke-em @kardianos).

Marking as release-blocker because deadlock and regression.

2020-10-28T19:19:04-bc0d7fd/freebsd-amd64-12_0 2020-10-28T16:55:17-d4c1ad8/openbsd-386-64

created time in 7 hours

issue closedgolang/go

cmd/go: 'go list -mod=readonly' erroneously resolves imports from replaced modules

When -mod=readonly is set, go list should refuse to resolve missing dependencies, and normally does.

However, if the dependency can be satisfied by adding a requirement on a module mentioned in a replace directive, the usual lookup disabled error message is suppressed, and go list instead fails with updates to go.mod needed:

example.com$ go version
go version devel +150bd4ff Wed Sep 23 07:51:17 2020 +0000 linux/amd64

example.com$ go list -mod=readonly example.com/x
cannot find module providing package example.com/x: import lookup disabled by -mod=readonly

example.com$ go mod edit -replace=example.com/x@v0.1.0=./x

example.com$ go list -mod=readonly example.com/x
go: found example.com/x in example.com/x v0.1.0
go: updates to go.mod needed, disabled by -mod=readonly

-- go.mod --
module example.com

go 1.16
-- x/go.mod --
module example.com/x

go 1.16
-- x/x.go --
package x

closed time in 9 hours

bcmills

issue commentgolang/go

cmd/go: crashes when -buildmode=shared is set and modules enabled

The attached go env output appears to be truncated, and I'm a bit confused at why the path in the panic traceback indicates go1.15.

@shawn-xdji, can you confirm the version of the go command you are using, and how to installed it (i.e. built from source, from an release downloaded from https://golang.org/dl/, or from some other package manager)?

shawn-xdji

comment created time in 11 hours

issue commentgolang/go

net/http: frequent failures in TestNoSnippExpectRequestBody_h2 since Oct. 28

CC @neild @odeke-em @ianlancetaylor

bcmills

comment created time in 11 hours

issue openedgolang/go

net/http: frequent failures in TestNoSnippExpectRequestBody_h2 since Oct. 28

2020-10-28T14:25:56-b85c2dd/aix-ppc64 2020-10-28T13:46:11-a0a4439/solaris-amd64-oraclerel 2020-10-28T13:25:44-72dec90/aix-ppc64 2020-10-28T04:20:39-02335cf/aix-ppc64 2020-10-28T01:22:47-2414e1f/aix-ppc64 2020-10-28T01:18:38-7be9158/solaris-amd64-oraclerel

Marking as release-blocker because this appears to be a regression in 1.16.

The failures so far are on somewhat esoteric builders, but those are also some of our slowest builders — this could be a timing bug that just happens to reproduce more easily on them.

created time in 11 hours

issue commentgolang/go

cmd/go: do not skip the cmd/go tests for linux/mips64le

Or, at the very least, perhaps we should use skipExternal = testing.Short() instead of skipExternal = true. That way, users can indicate their willingness to wait via the -short flag.

XiaodongLoong

comment created time in a day

issue commentgolang/go

cmd/go: do not skip the cmd/go tests for linux/mips64le

I think the skipExternal = true cases in func init should be moved into the testenv.Builder() != "" condition.

I agree that we still don't want to run these tests on the Go project's builders, but we should not assume that our builders are the only ones running the tests on these platforms.

XiaodongLoong

comment created time in a day

issue openedgolang/go

runtime,time: test timeouts / deadlocks after CL 232298

There appears to be an uptick in test timeouts (perhaps deadlocks?) in the OpenBSD and NetBSD builders on or around CL 232298. Since that CL affects runtime timers, we should investigate the failures to see whether it introduced a regression that could account for these timeouts.

2020-10-27T18:38:48-f0c9ae5/netbsd-amd64-9_0 2020-10-27T18:23:46-e3bb53a/openbsd-amd64-62 2020-10-27T18:13:59-3f6b1a0/netbsd-386-9_0 2020-10-27T18:13:59-3f6b1a0/netbsd-amd64-9_0 2020-10-27T18:13:59-3f6b1a0/openbsd-amd64-62 2020-10-27T17:24:42-8fdc79e/openbsd-amd64-62

CC @ALTree @ChrisHines @ianlancetaylor @aclements

created time in a day

issue openedgolang/go

cmd/go: 'go vet cmd' fails with "use of internal package" when run in GOROOT/src/cmd

~/go-review/src/cmd$ go version
go version devel +320cc79002 Tue Oct 27 12:36:54 2020 +0000 linux/amd64

~/go-review/src/cmd$ go vet cmd
package cmd/vendor/github.com/google/pprof/driver
        vendor/github.com/google/pprof/driver/driver.go:24:2: use of internal package github.com/google/pprof/internal/driver not allowed
package cmd/vendor/github.com/google/pprof/driver
        vendor/github.com/google/pprof/driver/driver.go:25:2: use of internal package github.com/google/pprof/internal/plugin not allowed
…

~/go-review/src/cmd$ cd ..

~/go-review/src$ go vet cmd

~/go-review/src$

I'm not actually sure whether this bug is in cmd/go or in cmd/vet.

There was a similar issue (#41358) in cmd/api which we resolved by omitting the vendored packages. However, in this case I think we really should be running vet on these packages — we just need to get go vet to interpret the imports from within those packages correctly.

This comment in cmd/go is related: https://github.com/golang/go/blob/ece7a33386a4fbd2ff9859902f780ed82120b985/src/cmd/go/internal/modload/load.go#L1151-L1155

CC @matloob @jayconrod

created time in a day

issue commentgolang/go

runtime: 'unexpected fault address 0x0' in crypto/sha256.blockGeneric on linux/mips64le

CC @randall77 @mengzhuo @cherrymui

XiaodongLoong

comment created time in a day

issue commentgolang/go

runtime: 'unexpected fault address 0x0' in evacuate_fast32 on linux-mips64le-mengzhuo builder

#42229 has a very similar failure mode.

bcmills

comment created time in a day

issue commentgolang/go

cmd/go/internal: signal SIGSEGV: segmentation violation code=0x80 addr=0x0 pc=0x120259a80

I suspect that this is a bug in the compiler or runtime specific to mips64le or perhaps MIPS in general.

The symptom is similar to #34835.

XiaodongLoong

comment created time in 2 days

issue commentgolang/go

cmd/go: revert special-case allowing "sync" to import "runtime/internal/atomic"

We definitely need to revert the change in src/cmd/go/internal/load/pkg.go, since that's adding the new special case that gopls is stumbling over.

It may be possible to rework the code to use go:linkname instead of directly importing the internal package. (I believe @aclements is looking into that now.) Otherwise, one possible approach might be to move runtime/internal/atomic to internal/atomic so that it can be imported in keeping with the existing internal rules.

hyangah

comment created time in 2 days

issue commentgolang/go

x/tools/gopls: reports an 'invalid use of internal package' error in sync/pool.go

Marking as release-blocker for Go 1.16 because this regression was introduced by a change in cmd/go in Go 1.16.

hyangah

comment created time in 2 days

issue openedgolang/go

runtime: lock ordering problem involving sysmon and rwmutexR

https://build.golang.org/log/c75fff17cab7b8b13d7261ea3463955e9536eb8b

--- FAIL: TestExec (0.03s)
    exec_unix_test.go:255: 33555  ======
        0 : sysmon 1 0x6b4cf8
        1 : rwmutexR 30 0x6e6980
        fatal error: lock ordering problem
        
        runtime stack:
        runtime.throw(0x5a65af, 0x15)
        	/workdir/go/src/runtime/panic.go:1112 +0x72
        runtime.checkRanks(0xc000000900, 0x1, 0x1e)
        	/workdir/go/src/runtime/lockrank_on.go:159 +0x10c
        runtime.lockWithRank.func1()
        	/workdir/go/src/runtime/lockrank_on.go:87 +0xbc
        runtime.lockWithRank(0x6e6980, 0x1e)
        	/workdir/go/src/runtime/lockrank_on.go:76 +0xa5
        runtime.(*rwmutex).runlock(0x6e6980)
        	/workdir/go/src/runtime/rwmutex.go:70 +0xa9
        runtime.newm1(0xc000480000)
        	/workdir/go/src/runtime/proc.go:2005 +0xb5
        runtime.newm(0x0, 0xc000102800, 0xc)
        	/workdir/go/src/runtime/proc.go:1988 +0xa6
        runtime.startm(0x0, 0x0)
        	/workdir/go/src/runtime/proc.go:2196 +0xb4
        runtime.sysmon()
        	/workdir/go/src/runtime/proc.go:5002 +0x366
        runtime.mstart1()
        	/workdir/go/src/runtime/proc.go:1207 +0xc8
        runtime.mstart()
        	/workdir/go/src/runtime/proc.go:1172 +0x6e

I'm guessing this is another missing partial-order edge.

CC @danscales @mknyszek

created time in 2 days

issue openedgolang/go

x/sys/unix: TestPselect failures due to shorter-than-expected timeout

--- FAIL: TestPselect (0.00s)
    syscall_linux_test.go:244: Pselect interrupted after 126.458µs
    syscall_linux_test.go:256: Pselect: timeout should have been at least 2.5ms, got 2.471501ms
FAIL
FAIL	golang.org/x/sys/unix	0.572s

2020-10-22T20:17:47-fb209a7/linux-amd64-nocgo 2020-09-28T20:51:50-006507a/linux-ppc64-buildlet 2020-09-05T00:46:54-be1d343/linux-386 2020-01-24T20:44:21-9fbb57f/linux-s390x-ibm

See previously #35555.

CC @tklauser @ianlancetaylor @bradfitz

created time in 3 days

issue openedgolang/go

x/sys/unix: "out of memory in thread_start" during TestPpoll on linux-386

<details>

runtime/cgo: out of memory in thread_start
SIGABRT: abort
PC=0xf7fb0b19 m=4 sigcode=4294967290

goroutine 0 [idle]:
runtime: unknown pc 0xf7fb0b19
stack: frame={sp:0xe6b18f80, fp:0x0} stack=[0xe6319730,0xe6b19330)
e6b18f00:  00000000  00000000  00000000  00000000 
e6b18f10:  00000000  00000000  00000000  00000000 
e6b18f20:  00000000  00000000  00000000  00000000 
e6b18f30:  00000000  00000000  00000000  00000000 
e6b18f40:  00000000  00000000  00000000  00000000 
e6b18f50:  00000000  00000000  00000000  00000000 
e6b18f60:  00000000  00000000  00000000  00000000 
e6b18f70:  00000000  00000000  00000000  00000000 
e6b18f80: <e6b18f90  00000000  e6b18f90  f7df9df0 
e6b18f90:  00000000  00000000  00000000  00000000 
e6b18fa0:  00000000  00000000  00000000  00000000 
e6b18fb0:  00000000  00000000  00000000  00000000 
e6b18fc0:  00000000  00000000  00000000  00000000 
e6b18fd0:  00000000  00000000  00000000  00000000 
e6b18fe0:  00000000  f7fbb4d0  f7de134c  08219287 
e6b18ff0:  00000000  00000000  00000000  00000000 
runtime: unknown pc 0xf7fb0b19
stack: frame={sp:0xe6b18f80, fp:0x0} stack=[0xe6319730,0xe6b19330)
e6b18f00:  00000000  00000000  00000000  00000000 
e6b18f10:  00000000  00000000  00000000  00000000 
e6b18f20:  00000000  00000000  00000000  00000000 
e6b18f30:  00000000  00000000  00000000  00000000 
e6b18f40:  00000000  00000000  00000000  00000000 
e6b18f50:  00000000  00000000  00000000  00000000 
e6b18f60:  00000000  00000000  00000000  00000000 
e6b18f70:  00000000  00000000  00000000  00000000 
e6b18f80: <e6b18f90  00000000  e6b18f90  f7df9df0 
e6b18f90:  00000000  00000000  00000000  00000000 
e6b18fa0:  00000000  00000000  00000000  00000000 
e6b18fb0:  00000000  00000000  00000000  00000000 
e6b18fc0:  00000000  00000000  00000000  00000000 
e6b18fd0:  00000000  00000000  00000000  00000000 
e6b18fe0:  00000000  f7fbb4d0  f7de134c  08219287 
e6b18ff0:  00000000  00000000  00000000  00000000 

goroutine 1 [runnable]:
testing.(*T).Run(0x9082460, 0x81df38a, 0xb, 0x81eb498, 0x401)
	/workdir/go/src/testing/testing.go:1219 +0x236
testing.runTests.func1(0x90015e0)
	/workdir/go/src/testing/testing.go:1491 +0x5a
testing.tRunner(0x90015e0, 0x9129eec)
	/workdir/go/src/testing/testing.go:1173 +0xb7
testing.runTests(0x900e100, 0x82ec7a0, 0x3a, 0x3a, 0x8ef8d664, 0xbfdd17d3, 0xb2d56a52, 0x8b, 0x82ef0e0, 0x901c48c)
	/workdir/go/src/testing/testing.go:1489 +0x25a
testing.(*M).Run(0x913e000, 0x0)
	/workdir/go/src/testing/testing.go:1397 +0x178
main.main()
	_testmain.go:159 +0x104

goroutine 71 [runnable]:
golang.org/x/sys/unix_test.TestPpoll.func1(0x9194380, 0x9192480)
	/workdir/gopath/src/golang.org/x/sys/unix/syscall_linux_test.go:106 +0x90
created by golang.org/x/sys/unix_test.TestPpoll
	/workdir/gopath/src/golang.org/x/sys/unix/syscall_linux_test.go:105 +0xa5

eax    0x0
ebx    0x2
ecx    0xe6b18f90
edx    0x0
edi    0x0
esi    0x8
ebp    0xe6b18f90
esp    0xe6b18f80
eip    0xf7fb0b19
eflags 0x282
cs     0x23
fs     0x0
gs     0x63
FAIL	golang.org/x/sys/unix	0.117s

</details>

2020-10-22T20:17:47-fb209a7/linux-386-longtest 2020-10-18T23:04:17-eeed37f/linux-386-longtest 2020-10-17T00:35:18-b09fb70/linux-386 2020-10-16T16:01:50-f659759/linux-386-longtest 2020-10-14T08:05:44-cc95f25/linux-386-longtest 2020-10-13T13:26:46-2da7054/linux-386-longtest 2020-09-30T18:57:26-fdedc70/linux-386 2020-09-18T17:44:21-af09f73/linux-386-longtest 2020-09-09T08:10:42-eff7692/linux-386-longtest 2020-09-08T13:41:30-d2e65c1/linux-386-longtest 2020-08-31T18:03:12-196b9ba/linux-386-longtest 2020-08-26T17:35:25-f9321e4/linux-386 2020-08-14T20:00:57-3d37ad5/linux-386-longtest 2020-06-25T21:21:54-ddb9806/linux-386 2020-06-25T21:21:54-ddb9806/linux-386-longtest 2020-06-22T21:40:17-ed371f2/linux-386-longtest 2020-06-15T19:00:26-2780627/linux-386 2020-05-19T10:57:57-fe76b77/linux-386-longtest 2020-05-01T14:52:40-bc7a7d4/linux-386 2020-03-02T15:01:41-5c8b2ff/linux-386

This test was added for #16052, but it's not at all clear to me why the test would fail in this way.

CC @tklauser @kortschak @ianlancetaylor

created time in 3 days

issue closedgolang/go

x/sys/unix: TestPpoll and TestPoll fail a `test all`

What version of Go are you using (go version)?

go version go1.11 linux/amd64

What did you do?

cd $(mktemp -d)
cat >ex.go <<.
package main

import (
	"fmt"

	_ "golang.org/x/sys/unix"
)

func main() {
	fmt.Println("example")
}

.
go mod init example && go test all; echo $?

What did you expect to see?

0

What did you see instead?

1

The tests fail, presumably because it's run in a non-writable place.

--- FAIL: TestPpoll (0.00s)
    syscall_unix_test.go:613: mktmpfifo: failed to create FIFO: permission denied
--- FAIL: TestPoll (0.00s)
    syscall_unix_test.go:613: mktmpfifo: failed to create FIFO: permission denied
FAIL
FAIL	golang.org/x/sys/unix	0.171s

With modules, is there a place that tests can write to?

closed time in 3 days

hdonnay

issue commentgolang/go

x/sys/unix: TestPpoll and TestPoll fail a `test all`

Fixed by CL 162987.

hdonnay

comment created time in 3 days

issue commentgolang/go

x/sys: TestFstatat failures on dragonfly-amd64

See previously #29401, #29447.

bcmills

comment created time in 3 days

issue openedgolang/go

x/sys: TestFstatat failures on dragonfly-amd64

TestFstatat appears to be flaky on the Dragonfly BSD builder:

--- FAIL: TestFstatat (0.00s)
    syscall_unix_test.go:674: Fstatat: returned stat does not match Stat
FAIL
FAIL	golang.org/x/sys/unix	1.885s

Since the test output is not particularly useful, it's not clear to me whether this is a bug in x/sys, in the test itself, or in the Dragonfly kernel.

2020-10-24T23:29:16-9f70ab9/dragonfly-amd64-5_8 2020-10-24T13:24:49-ef9fd89/dragonfly-amd64-5_8 2020-10-20T23:07:47-6e5568b/dragonfly-amd64-5_8 2020-10-18T23:04:17-eeed37f/dragonfly-amd64-5_8 2020-10-16T16:01:50-f659759/dragonfly-amd64-5_8 2020-10-14T08:05:44-cc95f25/dragonfly-amd64 2020-10-14T08:05:44-cc95f25/dragonfly-amd64-5_8 2020-10-06T15:56:30-ac719f4/dragonfly-amd64 2020-09-23T18:26:05-d9f96fd/dragonfly-amd64-5_8 2020-09-22T07:02:32-aee5d88/dragonfly-amd64-5_8 2020-09-18T17:44:21-af09f73/dragonfly-amd64 2020-09-18T17:44:21-af09f73/dragonfly-amd64-5_8 2020-09-17T07:31:48-efd3b9a/dragonfly-amd64-5_8 2020-09-16T08:47:44-dbad9cb/dragonfly-amd64-5_8 2020-08-28T19:40:41-157a740/dragonfly-amd64 2020-07-27T15:44:30-2d971f7/dragonfly-amd64-5_8 2020-07-20T21:16:30-cb9d2d5/dragonfly-amd64 2020-04-13T16:56:38-669c56c/dragonfly-amd64 2020-01-22T13:43:26-e047566/dragonfly-amd64 2020-01-22T13:43:26-e047566/dragonfly-amd64-5_6 2020-01-21T08:24:15-34d2753/dragonfly-amd64-5_6 2020-01-17T14:54:32-59e60aa/dragonfly-amd64-5_6 2019-12-23T22:40:30-abf886d/dragonfly-amd64-5_6 2019-12-20T22:00:14-0732a99/dragonfly-amd64 2019-12-20T22:00:14-0732a99/dragonfly-amd64-5_6 2019-12-20T14:29:24-d4481ac/dragonfly-amd64 2019-12-19T23:57:34-af0d71d/dragonfly-amd64 2019-12-19T23:57:34-af0d71d/dragonfly-amd64-5_6 2019-12-18T08:49:08-4a24b40/dragonfly-amd64-5_6 2019-12-10T02:34:23-ac6580d/dragonfly-amd64 2019-12-10T02:34:23-ac6580d/dragonfly-amd64-5_6 2019-12-06T22:06:18-eeba5f6/dragonfly-amd64 2019-12-06T21:42:22-bc7efcf/dragonfly-amd64 2019-12-04T07:23:24-ce4227a/dragonfly-amd64 2019-11-28T01:58:09-6d18c01/dragonfly-amd64 2019-11-27T02:17:46-63cb32a/dragonfly-amd64 2019-11-26T13:16:56-8a8471f/dragonfly-amd64 2019-11-20T15:59:48-bd43791/dragonfly-amd64 2019-11-19T06:07:38-e882bf8/dragonfly-amd64 2019-11-18T13:31:27-cf1e2d5/dragonfly-amd64 2019-11-18T01:35:47-6254a7c/dragonfly-amd64 2019-11-17T21:15:29-81af739/dragonfly-amd64 2019-11-15T15:19:21-52ab431/dragonfly-amd64 2019-11-13T16:50:36-4c7a9d0/dragonfly-amd64

CC @tklauser @tuxillo

created time in 3 days

issue commentgolang/go

x/sync/errgroup: why not recover the fn's err in errgroup

@ash2k, it is possible for a library to change the behavior either way.

Consider:

func unrecover(f func()) {
	defer func() {
		if r := recover(); r != nil {
			go panic(r)  // Move the panic to a new goroutine so that it cannot be recovered.
		}
	}()

	f()
}
henrycjchen

comment created time in 3 days

issue commentgolang/go

proposal: path/filepath: add WalkDir (Walk using DirEntry)

To me, the ability to easily convert callers using filepath.Walk to use io/fs and the DirEntry API is compelling. Any cleaner / simpler / different-style API is not likely to address that use-case, so it seems to me that we will want some API very close to filepath.Walk regardless of whether we also decide to add an iterator-based API.

WalkDir addresses the known use-case of “something close enough to filepath.Walk to make porting easy”, so I think we should go ahead and add it. Then we can decide the separate use-case of “something simpler or less error-prone than filepath.Walk” without the time pressure of holding up the migration of existing code to io/fs.

rsc

comment created time in 6 days

issue commentgolang/go

cmd/go: 'go get -d' does not report line numbers in errors for bad import statements

I'm not sure. I'm still in the process of overhauling the go get implementation for #36460.

bcmills

comment created time in 6 days

issue closedgolang/go

x/tools/gopls: show signature help when typing a struct as an argument to a function?

What version?

$ go version
go version devel +4c7a18d74 Thu Oct 22 01:20:16 2020 +0000 linux/amd64

$ go version -m $(which gopls)
/usr/local/google/home/bcmills/bin/gopls: devel +186f0220d0 Mon Oct 5 11:12:24 2020 -0400
        path    golang.org/x/tools/gopls
        mod     golang.org/x/tools/gopls        v0.5.1  h1:AF3Uh7HF08SZpKFfgJO6zfF3bbxyDXWqdkK4kMXiQ1o=
        dep     github.com/BurntSushi/toml      v0.3.1  h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
        dep     github.com/google/go-cmp        v0.5.1  h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=
        dep     github.com/sergi/go-diff        v1.1.0  h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
        dep     golang.org/x/mod        v0.3.0  h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
        dep     golang.org/x/sync       v0.0.0-20200625203802-6e8e738ad208      h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=
        dep     golang.org/x/tools      v0.0.0-20200930165741-f1523d29dbb9      h1:1R38tQp22dcHpTKJPjgVa16FhlDy/kHEaCM/ndi/FIc=
        dep     golang.org/x/xerrors    v0.0.0-20200804184101-5ec99f83aff1      h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
        dep     honnef.co/go/tools      v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=
        dep     mvdan.cc/gofumpt        v0.0.0-20200802201014-ab5a8192947d      h1:t8TAw9WgTLghti7RYkpPmqk4JtQ3+wcP5GgZqgWeWLQ=
        dep     mvdan.cc/xurls/v2       v2.2.0  h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=

What did you do?

$ cat > example.go
package example

import "os"

func F() {
        var errs []*os.PathError
        errs = append(errs, &os.PathError{
                // Place cursor here.
        })
        _ = errs
}

$ emacs example.go
  • Move the cursor to the beginning of the // Place cursor here. comment.

What did you expect to see?

Hover information about the fields of the containing struct.

What did you see instead?

Hover information about the built-in append function.

<details>

[Trace - 11:29:14.338 AM] Sending request 'initialize - (1)'.
Params: {"processId":595917,"rootPath":"/tmp/tmp.6zQzInLjRX/example.com/","rootUri":"file:///tmp/tmp.6zQzInLjRX/example.com/","initializationOptions":null,"capabilities":{"workspace":{"applyEdit":true,"executeCommand":{"dynamicRegistration":false},"workspaceEdit":{"documentChanges":false},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":false},"configuration":true},"textDocument":{"synchronization":{"dynamicRegistration":false,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":false,"completionItem":{"snippetSupport":true},"contextSupport":true},"hover":{"dynamicRegistration":false,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":false,"signatureInformation":{"parameterInformation":{"labelOffsetSupport":true}}},"references":{"dynamicRegistration":false},"definition":{"dynamicRegistration":false},"declaration":{"dynamicRegistration":false},"implementation":{"dynamicRegistration":false},"typeDefinition":{"dynamicRegistration":false},"documentSymbol":{"dynamicRegistration":false,"hierarchicalDocumentSymbolSupport":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"documentHighlight":{"dynamicRegistration":false},"codeAction":{"dynamicRegistration":false,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"formatting":{"dynamicRegistration":false},"rangeFormatting":{"dynamicRegistration":false},"rename":{"dynamicRegistration":false},"publishDiagnostics":{"relatedInformation":false}},"experimental":null}}


[Trace - 11:29:14.339 AM] Received response 'initialize - (1)' in 1ms.
Result: {"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":["."]},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor.extract","refactor.rewrite","source.fixAll","source.organizeImports"]},"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":""},"renameProvider":true,"foldingRangeProvider":true,"executeCommandProvider":{"commands":["generate","fill_struct","regenerate_cgo","test","tidy","undeclared_name","upgrade_dependency","vendor","extract_variable","extract_function","gc_details","generate_gopls_mod"]},"callHierarchyProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorkspaceFolders"}}},"serverInfo":{"name":"gopls","version":"Build info\n----------\ngolang.org/x/tools/gopls v0.5.1\n    golang.org/x/tools/gopls@v0.5.1 h1:AF3Uh7HF08SZpKFfgJO6zfF3bbxyDXWqdkK4kMXiQ1o=\n    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=\n    github.com/google/go-cmp@v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=\n    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=\n    golang.org/x/mod@v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=\n    golang.org/x/sync@v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=\n    golang.org/x/tools@v0.0.0-20200930165741-f1523d29dbb9 h1:1R38tQp22dcHpTKJPjgVa16FhlDy/kHEaCM/ndi/FIc=\n    golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=\n    honnef.co/go/tools@v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=\n    mvdan.cc/gofumpt@v0.0.0-20200802201014-ab5a8192947d h1:t8TAw9WgTLghti7RYkpPmqk4JtQ3+wcP5GgZqgWeWLQ=\n    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=\n"}}


[Trace - 11:29:14.341 AM] Sending notification 'initialized'.
Params: {}


[Trace - 11:29:14.341 AM] Received notification 'window/showMessage'.
Params: {"type":4,"message":"Loading packages..."}


[Trace - 11:29:14.341 AM] Received request 'workspace/configuration - (1)'.
Params: {"items":[{"scopeUri":"file:///tmp/tmp.6zQzInLjRX/example.com/","section":"gopls"},{"scopeUri":"file:///tmp/tmp.6zQzInLjRX/example.com/","section":"gopls-example.com"}]}


[Trace - 11:29:14.343 AM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.6zQzInLjRX/example.com/example.go","version":0,"languageId":"go","text":"package example\n\nimport \"os\"\n\nfunc F() {\n\tvar errs []*os.PathError\n\terrs = append(errs, &os.PathError{\n\t\t// Place cursor here.\n\t})\n\t_ = errs\n}\n"}}


[Trace - 11:29:14.344 AM] Sending notification 'workspace/didChangeConfiguration'.
Params: {"settings":{"gopls":{"staticcheck":true,"matcher":"CaseSensitive"}}}


[Trace - 11:29:14.346 AM] Sending request 'textDocument/documentSymbol - (2)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.6zQzInLjRX/example.com/example.go"}}


[Trace - 11:29:14.351 AM] Sending response 'workspace/configuration - (1)' in 9ms.
Result: [{"staticcheck":true,"matcher":"CaseSensitive"},null]


[Trace - 11:29:14.418 AM] Received request 'client/registerCapability - (2)'.
Params: {"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{go,mod,sum}","kind":7},{"globPattern":"/tmp/tmp.6zQzInLjRX/example.com/**/*.{go,mod,sum}","kind":7}]}}]}


[Trace - 11:29:14.418 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/10/22 11:29:14 go env for /tmp/tmp.6zQzInLjRX/example.com/\n(root /tmp/tmp.6zQzInLjRX/example.com)\n(go version go version devel +4c7a18d74 Thu Oct 22 01:20:16 2020 +0000 linux/amd64\n)\n(valid build configuration = true)\n(build flags: [])\nGOMODCACHE=/tmp/tmp.6zQzInLjRX/_gopath/pkg/mod\nGOPROXY=https://proxy.golang.org,direct\nGOMOD=/tmp/tmp.6zQzInLjRX/example.com/go.mod\nGOPATH=/tmp/tmp.6zQzInLjRX/_gopath\nGOROOT=/usr/local/google/home/bcmills/sdk/gotip\nGO111MODULE=auto\nGOINSECURE=\nGONOSUMDB=\nGOPRIVATE=\nGOSUMDB=sum.golang.org\nGOCACHE=/usr/local/google/home/bcmills/.cache/go-build\nGOFLAGS=\nGONOPROXY=\n\n"}


[Trace - 11:29:14.418 AM] Sending response 'client/registerCapability - (2)' in 0ms.
Result: 


[Trace - 11:29:14.674 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/10/22 11:29:14 go/packages.Load\n\tsnapshot=0\n\tdirectory=/tmp/tmp.6zQzInLjRX/example.com\n\tquery=[./... builtin]\n\tpackages=2\n"}


[Trace - 11:29:14.705 AM] Received notification 'window/showMessage'.
Params: {"type":3,"message":"Finished loading packages."}


[Trace - 11:29:14.705 AM] Received request 'workspace/configuration - (3)'.
Params: {"items":[{"scopeUri":"file:///tmp/tmp.6zQzInLjRX/example.com/","section":"gopls"},{"scopeUri":"file:///tmp/tmp.6zQzInLjRX/example.com/","section":"gopls-example.com"}]}


[Trace - 11:29:14.747 AM] Sending response 'workspace/configuration - (3)' in 41ms.
Result: [{"staticcheck":true,"matcher":"CaseSensitive"},null]


[Trace - 11:29:14.778 AM] Received response 'textDocument/documentSymbol - (2)' in 432ms.
Result: [{"name":"F","detail":"()","kind":12,"range":{"start":{"line":4,"character":0},"end":{"line":10,"character":1}},"selectionRange":{"start":{"line":4,"character":5},"end":{"line":4,"character":6}}}]


[Trace - 11:29:14.832 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///tmp/tmp.6zQzInLjRX/example.com/example.go","diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":15}},"severity":2,"source":"ST1000","message":"at least one file in a package should have a package comment"}]}


[Trace - 11:29:18.761 AM] Sending request 'textDocument/signatureHelp - (3)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.6zQzInLjRX/example.com/example.go"},"position":{"line":7,"character":2}}


[Trace - 11:29:18.762 AM] Sending request 'textDocument/hover - (4)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.6zQzInLjRX/example.com/example.go"},"position":{"line":7,"character":2}}


[Trace - 11:29:18.767 AM] Received response 'textDocument/signatureHelp - (3)' in 5ms.
Result: {"signatures":[{"label":"append(slice []Type, elems ...Type) []Type","documentation":"The append built-in function appends elements to the end of a slice.","parameters":[{"label":"slice []Type"},{"label":"elems ...Type"}]}],"activeSignature":0,"activeParameter":1}


[Trace - 11:29:18.767 AM] Sending request 'textDocument/documentHighlight - (5)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.6zQzInLjRX/example.com/example.go"},"position":{"line":7,"character":2}}


[Trace - 11:29:18.767 AM] Received response 'textDocument/hover - (4)' in 5ms.
Result: null


[Trace - 11:29:18.768 AM] Received response 'textDocument/documentHighlight - (5)' in 0ms.
Result: []


</details>

closed time in 6 days

bcmills

issue commentgolang/go

x/tools/gopls: show signature help when typing a struct as an argument to a function?

Ah, I see. That's unfortunate — I was really hoping for something a little more context-aware.

bcmills

comment created time in 6 days

issue commentgolang/go

x/tools/gopls: show signature help when typing a struct as an argument to a function?

it probably wouldn't work well for gopls to be checking if the user typed the opening { for a struct on every file change.

Could you elaborate? (It's already checking whether the user typed the opening ( for a function call on every file change, isn't it? Or is the signature help triggered some other way?)

bcmills

comment created time in 6 days

issue commentgolang/go

x/tools/gopls: show signature help when typing a struct as an argument to a function?

Oh, neato! Yeah, if I run M-x company-complete I do get the expected completions.

So, I guess what's missing here is a mechanism in the LSP protocol, so that gopls could notify the client that completions are available even though there is no trigger character?

bcmills

comment created time in 6 days

issue commentgolang/go

x/tools/gopls: show signature help when typing a struct as an argument to a function?

Yeah, just removing the signature wouldn't be particularly helpful: I really want some guidance for the struct fields.

I guess a simpler reproducer is:

package example

import "os"

func F() error {
	return &os.PathError{
		// Place cursor here.
	}
}

In that case, I get no hovers or completions at all. I guess the idea is that I should use a Fill <struct> action here? (But I don't want to actually fill in the struct — I just want to see which fields I could set.)

My initial reaction was that I should get a hover with a doc summary for the struct type, but maybe that's not quite right either. Maybe I actually want completions for all of the struct fields that aren't already present in the declaration?

bcmills

comment created time in 6 days

issue openedgolang/go

x/tools/gopls: unhelpful hover content inside a struct passed as an argument to 'append'

What version?

$ go version
go version devel +4c7a18d74 Thu Oct 22 01:20:16 2020 +0000 linux/amd64

$ go version -m $(which gopls)
/usr/local/google/home/bcmills/bin/gopls: devel +186f0220d0 Mon Oct 5 11:12:24 2020 -0400
        path    golang.org/x/tools/gopls
        mod     golang.org/x/tools/gopls        v0.5.1  h1:AF3Uh7HF08SZpKFfgJO6zfF3bbxyDXWqdkK4kMXiQ1o=
        dep     github.com/BurntSushi/toml      v0.3.1  h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
        dep     github.com/google/go-cmp        v0.5.1  h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=
        dep     github.com/sergi/go-diff        v1.1.0  h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
        dep     golang.org/x/mod        v0.3.0  h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
        dep     golang.org/x/sync       v0.0.0-20200625203802-6e8e738ad208      h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=
        dep     golang.org/x/tools      v0.0.0-20200930165741-f1523d29dbb9      h1:1R38tQp22dcHpTKJPjgVa16FhlDy/kHEaCM/ndi/FIc=
        dep     golang.org/x/xerrors    v0.0.0-20200804184101-5ec99f83aff1      h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
        dep     honnef.co/go/tools      v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=
        dep     mvdan.cc/gofumpt        v0.0.0-20200802201014-ab5a8192947d      h1:t8TAw9WgTLghti7RYkpPmqk4JtQ3+wcP5GgZqgWeWLQ=
        dep     mvdan.cc/xurls/v2       v2.2.0  h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=

What did you do?

$ cat > example.go
package example

import "os"

func F() {
        var errs []*os.PathError
        errs = append(errs, &os.PathError{
                // Place cursor here.
        })
        _ = errs
}

$ emacs example.go
  • Move the cursor to the beginning of the // Place cursor here. comment.

What did you expect to see?

Hover information about the fields of the containing struct.

What did you see instead?

Hover information about the built-in append function.

<details>

[Trace - 11:29:14.338 AM] Sending request 'initialize - (1)'.
Params: {"processId":595917,"rootPath":"/tmp/tmp.6zQzInLjRX/example.com/","rootUri":"file:///tmp/tmp.6zQzInLjRX/example.com/","initializationOptions":null,"capabilities":{"workspace":{"applyEdit":true,"executeCommand":{"dynamicRegistration":false},"workspaceEdit":{"documentChanges":false},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":false},"configuration":true},"textDocument":{"synchronization":{"dynamicRegistration":false,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":false,"completionItem":{"snippetSupport":true},"contextSupport":true},"hover":{"dynamicRegistration":false,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":false,"signatureInformation":{"parameterInformation":{"labelOffsetSupport":true}}},"references":{"dynamicRegistration":false},"definition":{"dynamicRegistration":false},"declaration":{"dynamicRegistration":false},"implementation":{"dynamicRegistration":false},"typeDefinition":{"dynamicRegistration":false},"documentSymbol":{"dynamicRegistration":false,"hierarchicalDocumentSymbolSupport":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"documentHighlight":{"dynamicRegistration":false},"codeAction":{"dynamicRegistration":false,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"formatting":{"dynamicRegistration":false},"rangeFormatting":{"dynamicRegistration":false},"rename":{"dynamicRegistration":false},"publishDiagnostics":{"relatedInformation":false}},"experimental":null}}


[Trace - 11:29:14.339 AM] Received response 'initialize - (1)' in 1ms.
Result: {"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":["."]},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor.extract","refactor.rewrite","source.fixAll","source.organizeImports"]},"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":""},"renameProvider":true,"foldingRangeProvider":true,"executeCommandProvider":{"commands":["generate","fill_struct","regenerate_cgo","test","tidy","undeclared_name","upgrade_dependency","vendor","extract_variable","extract_function","gc_details","generate_gopls_mod"]},"callHierarchyProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorkspaceFolders"}}},"serverInfo":{"name":"gopls","version":"Build info\n----------\ngolang.org/x/tools/gopls v0.5.1\n    golang.org/x/tools/gopls@v0.5.1 h1:AF3Uh7HF08SZpKFfgJO6zfF3bbxyDXWqdkK4kMXiQ1o=\n    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=\n    github.com/google/go-cmp@v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=\n    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=\n    golang.org/x/mod@v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=\n    golang.org/x/sync@v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=\n    golang.org/x/tools@v0.0.0-20200930165741-f1523d29dbb9 h1:1R38tQp22dcHpTKJPjgVa16FhlDy/kHEaCM/ndi/FIc=\n    golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=\n    honnef.co/go/tools@v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=\n    mvdan.cc/gofumpt@v0.0.0-20200802201014-ab5a8192947d h1:t8TAw9WgTLghti7RYkpPmqk4JtQ3+wcP5GgZqgWeWLQ=\n    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=\n"}}


[Trace - 11:29:14.341 AM] Sending notification 'initialized'.
Params: {}


[Trace - 11:29:14.341 AM] Received notification 'window/showMessage'.
Params: {"type":4,"message":"Loading packages..."}


[Trace - 11:29:14.341 AM] Received request 'workspace/configuration - (1)'.
Params: {"items":[{"scopeUri":"file:///tmp/tmp.6zQzInLjRX/example.com/","section":"gopls"},{"scopeUri":"file:///tmp/tmp.6zQzInLjRX/example.com/","section":"gopls-example.com"}]}


[Trace - 11:29:14.343 AM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.6zQzInLjRX/example.com/example.go","version":0,"languageId":"go","text":"package example\n\nimport \"os\"\n\nfunc F() {\n\tvar errs []*os.PathError\n\terrs = append(errs, &os.PathError{\n\t\t// Place cursor here.\n\t})\n\t_ = errs\n}\n"}}


[Trace - 11:29:14.344 AM] Sending notification 'workspace/didChangeConfiguration'.
Params: {"settings":{"gopls":{"staticcheck":true,"matcher":"CaseSensitive"}}}


[Trace - 11:29:14.346 AM] Sending request 'textDocument/documentSymbol - (2)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.6zQzInLjRX/example.com/example.go"}}


[Trace - 11:29:14.351 AM] Sending response 'workspace/configuration - (1)' in 9ms.
Result: [{"staticcheck":true,"matcher":"CaseSensitive"},null]


[Trace - 11:29:14.418 AM] Received request 'client/registerCapability - (2)'.
Params: {"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{go,mod,sum}","kind":7},{"globPattern":"/tmp/tmp.6zQzInLjRX/example.com/**/*.{go,mod,sum}","kind":7}]}}]}


[Trace - 11:29:14.418 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/10/22 11:29:14 go env for /tmp/tmp.6zQzInLjRX/example.com/\n(root /tmp/tmp.6zQzInLjRX/example.com)\n(go version go version devel +4c7a18d74 Thu Oct 22 01:20:16 2020 +0000 linux/amd64\n)\n(valid build configuration = true)\n(build flags: [])\nGOMODCACHE=/tmp/tmp.6zQzInLjRX/_gopath/pkg/mod\nGOPROXY=https://proxy.golang.org,direct\nGOMOD=/tmp/tmp.6zQzInLjRX/example.com/go.mod\nGOPATH=/tmp/tmp.6zQzInLjRX/_gopath\nGOROOT=/usr/local/google/home/bcmills/sdk/gotip\nGO111MODULE=auto\nGOINSECURE=\nGONOSUMDB=\nGOPRIVATE=\nGOSUMDB=sum.golang.org\nGOCACHE=/usr/local/google/home/bcmills/.cache/go-build\nGOFLAGS=\nGONOPROXY=\n\n"}


[Trace - 11:29:14.418 AM] Sending response 'client/registerCapability - (2)' in 0ms.
Result: 


[Trace - 11:29:14.674 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/10/22 11:29:14 go/packages.Load\n\tsnapshot=0\n\tdirectory=/tmp/tmp.6zQzInLjRX/example.com\n\tquery=[./... builtin]\n\tpackages=2\n"}


[Trace - 11:29:14.705 AM] Received notification 'window/showMessage'.
Params: {"type":3,"message":"Finished loading packages."}


[Trace - 11:29:14.705 AM] Received request 'workspace/configuration - (3)'.
Params: {"items":[{"scopeUri":"file:///tmp/tmp.6zQzInLjRX/example.com/","section":"gopls"},{"scopeUri":"file:///tmp/tmp.6zQzInLjRX/example.com/","section":"gopls-example.com"}]}


[Trace - 11:29:14.747 AM] Sending response 'workspace/configuration - (3)' in 41ms.
Result: [{"staticcheck":true,"matcher":"CaseSensitive"},null]


[Trace - 11:29:14.778 AM] Received response 'textDocument/documentSymbol - (2)' in 432ms.
Result: [{"name":"F","detail":"()","kind":12,"range":{"start":{"line":4,"character":0},"end":{"line":10,"character":1}},"selectionRange":{"start":{"line":4,"character":5},"end":{"line":4,"character":6}}}]


[Trace - 11:29:14.832 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///tmp/tmp.6zQzInLjRX/example.com/example.go","diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":15}},"severity":2,"source":"ST1000","message":"at least one file in a package should have a package comment"}]}


[Trace - 11:29:18.761 AM] Sending request 'textDocument/signatureHelp - (3)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.6zQzInLjRX/example.com/example.go"},"position":{"line":7,"character":2}}


[Trace - 11:29:18.762 AM] Sending request 'textDocument/hover - (4)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.6zQzInLjRX/example.com/example.go"},"position":{"line":7,"character":2}}


[Trace - 11:29:18.767 AM] Received response 'textDocument/signatureHelp - (3)' in 5ms.
Result: {"signatures":[{"label":"append(slice []Type, elems ...Type) []Type","documentation":"The append built-in function appends elements to the end of a slice.","parameters":[{"label":"slice []Type"},{"label":"elems ...Type"}]}],"activeSignature":0,"activeParameter":1}


[Trace - 11:29:18.767 AM] Sending request 'textDocument/documentHighlight - (5)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.6zQzInLjRX/example.com/example.go"},"position":{"line":7,"character":2}}


[Trace - 11:29:18.767 AM] Received response 'textDocument/hover - (4)' in 5ms.
Result: null


[Trace - 11:29:18.768 AM] Received response 'textDocument/documentHighlight - (5)' in 0ms.
Result: []


</details>

created time in 6 days

issue openedgolang/go

x/tools/gopls: rename fails to update doc comment for local variable of function type

What version are you using?

<pre> $ go version go version devel +491fe1b95 Wed Oct 21 07:36:08 2020 +0000 linux/amd64

$ go version -m $(which gopls) /usr/local/google/home/bcmills/bin/gopls: devel +186f0220d0 Mon Oct 5 11:12:24 2020 -0400 path golang.org/x/tools/gopls mod golang.org/x/tools/gopls v0.5.1 h1:AF3Uh7HF08SZpKFfgJO6zfF3bbxyDXWqdkK4kMXiQ1o= dep github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= dep github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= dep github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= dep golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= dep golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= dep golang.org/x/tools v0.0.0-20200930165741-f1523d29dbb9 h1:1R38tQp22dcHpTKJPjgVa16FhlDy/kHEaCM/ndi/FIc= dep golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= dep honnef.co/go/tools v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k= dep mvdan.cc/gofumpt v0.0.0-20200802201014-ab5a8192947d h1:t8TAw9WgTLghti7RYkpPmqk4JtQ3+wcP5GgZqgWeWLQ= dep mvdan.cc/xurls/v2 v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=

</pre>

What did you do?

$ cat > example.go
package example

func F() {
	// f computes things.
	f := func() {}

	f()
}

$ emacs example.go
  • Move the cursor to the start of f := (at example.go:5:2).

  • M-x eglot-rename and enter a new name (g).

What did you expect to see?

Since the initial comment for local function f follows the Go convention for function documentation, the comment should be updated to remain consistent with that documentation: // g computes things.

What did you see instead?

The variable declaration and call site are updated, but the comment is not.

<details>

[Trace - 22:08:49.202 PM] Sending request 'initialize - (1)'.
Params: {"processId":471498,"rootPath":"/tmp/tmp.34b4txjdJE/example.com/","rootUri":"file:///tmp/tmp.34b4txjdJE/example.com/","initializationOptions":null,"capabilities":{"workspace":{"applyEdit":true,"executeCommand":{"dynamicRegistration":false},"workspaceEdit":{"documentChanges":false},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":false},"configuration":true},"textDocument":{"synchronization":{"dynamicRegistration":false,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":false,"completionItem":{"snippetSupport":true},"contextSupport":true},"hover":{"dynamicRegistration":false,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":false,"signatureInformation":{"parameterInformation":{"labelOffsetSupport":true}}},"references":{"dynamicRegistration":false},"definition":{"dynamicRegistration":false},"declaration":{"dynamicRegistration":false},"implementation":{"dynamicRegistration":false},"typeDefinition":{"dynamicRegistration":false},"documentSymbol":{"dynamicRegistration":false,"hierarchicalDocumentSymbolSupport":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"documentHighlight":{"dynamicRegistration":false},"codeAction":{"dynamicRegistration":false,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"formatting":{"dynamicRegistration":false},"rangeFormatting":{"dynamicRegistration":false},"rename":{"dynamicRegistration":false},"publishDiagnostics":{"relatedInformation":false}},"experimental":null}}


[Trace - 22:08:49.204 PM] Received response 'initialize - (1)' in 1ms.
Result: {"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":["."]},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor.extract","refactor.rewrite","source.fixAll","source.organizeImports"]},"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":""},"renameProvider":true,"foldingRangeProvider":true,"executeCommandProvider":{"commands":["generate","fill_struct","regenerate_cgo","test","tidy","undeclared_name","upgrade_dependency","vendor","extract_variable","extract_function","gc_details","generate_gopls_mod"]},"callHierarchyProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorkspaceFolders"}}},"serverInfo":{"name":"gopls","version":"Build info\n----------\ngolang.org/x/tools/gopls v0.5.1\n    golang.org/x/tools/gopls@v0.5.1 h1:AF3Uh7HF08SZpKFfgJO6zfF3bbxyDXWqdkK4kMXiQ1o=\n    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=\n    github.com/google/go-cmp@v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=\n    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=\n    golang.org/x/mod@v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=\n    golang.org/x/sync@v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=\n    golang.org/x/tools@v0.0.0-20200930165741-f1523d29dbb9 h1:1R38tQp22dcHpTKJPjgVa16FhlDy/kHEaCM/ndi/FIc=\n    golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=\n    honnef.co/go/tools@v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=\n    mvdan.cc/gofumpt@v0.0.0-20200802201014-ab5a8192947d h1:t8TAw9WgTLghti7RYkpPmqk4JtQ3+wcP5GgZqgWeWLQ=\n    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=\n"}}


[Trace - 22:08:49.205 PM] Sending notification 'initialized'.
Params: {}


[Trace - 22:08:49.206 PM] Received notification 'window/showMessage'.
Params: {"type":4,"message":"Loading packages..."}


[Trace - 22:08:49.206 PM] Received request 'workspace/configuration - (1)'.
Params: {"items":[{"scopeUri":"file:///tmp/tmp.34b4txjdJE/example.com/","section":"gopls"},{"scopeUri":"file:///tmp/tmp.34b4txjdJE/example.com/","section":"gopls-example.com"}]}


[Trace - 22:08:49.207 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.34b4txjdJE/example.com/example.go","version":0,"languageId":"go","text":"package example\n\nfunc F() {\n\t// f computes things.\n\tf := func() {}\n\n\tf()\n}\n"}}


[Trace - 22:08:49.207 PM] Sending notification 'workspace/didChangeConfiguration'.
Params: {"settings":{"gopls":{"staticcheck":true,"matcher":"CaseSensitive"}}}


[Trace - 22:08:49.208 PM] Sending request 'textDocument/documentSymbol - (2)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.34b4txjdJE/example.com/example.go"}}


[Trace - 22:08:49.217 PM] Sending response 'workspace/configuration - (1)' in 11ms.
Result: [{"staticcheck":true,"matcher":"CaseSensitive"},null]


[Trace - 22:08:49.254 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/10/21 22:08:49 go env for /tmp/tmp.34b4txjdJE/example.com/\n(root /tmp/tmp.34b4txjdJE/example.com)\n(go version go version devel +491fe1b95 Wed Oct 21 07:36:08 2020 +0000 linux/amd64\n)\n(valid build configuration = true)\n(build flags: [])\nGOPRIVATE=\nGO111MODULE=auto\nGOCACHE=/usr/local/google/home/bcmills/.cache/go-build\nGOPATH=/tmp/tmp.34b4txjdJE/_gopath\nGOPROXY=https://proxy.golang.org,direct\nGOSUMDB=sum.golang.org\nGOFLAGS=\nGOINSECURE=\nGOROOT=/usr/local/google/home/bcmills/sdk/gotip\nGONOPROXY=\nGONOSUMDB=\nGOMOD=/tmp/tmp.34b4txjdJE/example.com/go.mod\nGOMODCACHE=/tmp/tmp.34b4txjdJE/_gopath/pkg/mod\n\n"}


[Trace - 22:08:49.254 PM] Received request 'client/registerCapability - (2)'.
Params: {"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{go,mod,sum}","kind":7},{"globPattern":"/tmp/tmp.34b4txjdJE/example.com/**/*.{go,mod,sum}","kind":7}]}}]}


[Trace - 22:08:49.255 PM] Sending response 'client/registerCapability - (2)' in 1ms.
Result: 


[Trace - 22:08:49.343 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/10/21 22:08:49 go/packages.Load\n\tsnapshot=0\n\tdirectory=/tmp/tmp.34b4txjdJE/example.com\n\tquery=[./... builtin]\n\tpackages=2\n"}


[Trace - 22:08:49.343 PM] Received notification 'window/showMessage'.
Params: {"type":3,"message":"Finished loading packages."}


[Trace - 22:08:49.344 PM] Received request 'workspace/configuration - (3)'.
Params: {"items":[{"scopeUri":"file:///tmp/tmp.34b4txjdJE/example.com/","section":"gopls"},{"scopeUri":"file:///tmp/tmp.34b4txjdJE/example.com/","section":"gopls-example.com"}]}


[Trace - 22:08:49.363 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///tmp/tmp.34b4txjdJE/example.com/example.go","diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":15}},"severity":2,"source":"ST1000","message":"at least one file in a package should have a package comment"}]}


[Trace - 22:08:49.366 PM] Sending response 'workspace/configuration - (3)' in 22ms.
Result: [{"staticcheck":true,"matcher":"CaseSensitive"},null]


[Trace - 22:08:49.367 PM] Received response 'textDocument/documentSymbol - (2)' in 158ms.
Result: [{"name":"F","detail":"()","kind":12,"range":{"start":{"line":2,"character":0},"end":{"line":7,"character":1}},"selectionRange":{"start":{"line":2,"character":5},"end":{"line":2,"character":6}}}]


[Trace - 22:08:51.295 PM] Sending request 'textDocument/signatureHelp - (3)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.34b4txjdJE/example.com/example.go"},"position":{"line":4,"character":1}}


[Trace - 22:08:51.296 PM] Received response 'textDocument/signatureHelp - (3)' in 0ms.
Result: null


[Trace - 22:08:51.296 PM] Sending request 'textDocument/hover - (4)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.34b4txjdJE/example.com/example.go"},"position":{"line":4,"character":1}}


[Trace - 22:08:51.296 PM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/10/21 22:08:51 no signature help: cannot find an enclosing function\n\tposition={4 1}\n"}


[Trace - 22:08:51.297 PM] Received response 'textDocument/hover - (4)' in 0ms.
Result: {"contents":{"kind":"markdown","value":"```go\nvar f func()\n```"},"range":{"start":{"line":4,"character":1},"end":{"line":4,"character":2}}}


[Trace - 22:08:51.297 PM] Sending request 'textDocument/documentHighlight - (5)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.34b4txjdJE/example.com/example.go"},"position":{"line":4,"character":1}}


[Trace - 22:08:51.298 PM] Received response 'textDocument/documentHighlight - (5)' in 0ms.
Result: [{"range":{"start":{"line":4,"character":1},"end":{"line":4,"character":2}},"kind":1},{"range":{"start":{"line":6,"character":1},"end":{"line":6,"character":2}},"kind":1}]


[Trace - 22:09:29.887 PM] Sending request 'textDocument/rename - (6)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.34b4txjdJE/example.com/example.go"},"position":{"line":4,"character":1},"newName":"g"}


[Trace - 22:09:29.888 PM] Received response 'textDocument/rename - (6)' in 0ms.
Result: {"documentChanges":[{"textDocument":{"version":0,"uri":"file:///tmp/tmp.34b4txjdJE/example.com/example.go"},"edits":[{"range":{"start":{"line":4,"character":1},"end":{"line":4,"character":2}},"newText":"g"},{"range":{"start":{"line":6,"character":1},"end":{"line":6,"character":2}},"newText":"g"}]}]}


[Trace - 22:09:34.399 PM] Sending notification 'textDocument/didChange'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.34b4txjdJE/example.com/example.go","version":2},"contentChanges":[{"range":{"start":{"line":6,"character":1},"end":{"line":6,"character":2}},"rangeLength":1,"text":"g"},{"range":{"start":{"line":4,"character":1},"end":{"line":4,"character":2}},"rangeLength":1,"text":"g"}]}


</details>

created time in 7 days

issue commentgolang/go

proposal: Go 2: sum types using interface type lists

@bokwoon95, the keyword interface seems to subtle to me for that use-case. (interface to me does not say “underlying type”.)

switch s.(underlying) seems reasonable, though, or switch underlying(s).

ianlancetaylor

comment created time in 7 days

issue commentgolang/go

coverage: [no statements]

-cover measures how much the test covers of the corresponding package.

In the example you have provided, the Sum function is part of the test itself (it is a test-helper function), not the package per se.

(Note that https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/arrays-and-slices#write-the-minimal-amount-of-code-for-the-test-to-run-and-check-the-failing-test-output begins, “In sum.go”.)

NickBishop2112

comment created time in 7 days

issue closedgolang/go

coverage: [no statements]

<!-- Please answer these questions before submitting your issue. Thanks! For questions please use one of our forums: https://github.com/golang/go/wiki/Questions -->

What version of Go are you using (go version)?

<pre> $ go version : 1.15.3 windows/amd64

</pre>

Does this issue reproduce with the latest release?

Still have the same issue with the latest version

What operating system and processor architecture are you using (go env)?

<details><summary><code>go env</code> Output</summary><br><pre> $ go env

set GO111MODULE= set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\Emptiness\AppData\Local\go-build set GOENV=C:\Users\Emptiness\AppData\Roaming\go\env set GOEXE=.exe set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOINSECURE= set GOMODCACHE=C:\Users\Emptiness\go\pkg\mod set GONOPROXY= set GONOSUMDB= set GOOS=windows set GOPATH=C:\Users\Emptiness\go set GOPRIVATE= set GOPROXY=https://proxy.golang.org,direct set GOROOT=c:\go set GOSUMDB=sum.golang.org set GOTMPDIR= set GOTOOLDIR=c:\go\pkg\tool\windows_amd64 set GCCGO=gccgo set AR=ar set CC=gcc set CXX=g++ set CGO_ENABLED=1 set GOMOD=C:\Users\Emptiness\source\repos\go-programming\go.mod set CGO_CFLAGS=-g -O2 set CGO_CPPFLAGS= set CGO_CXXFLAGS=-g -O2 set CGO_FFLAGS=-g -O2 set CGO_LDFLAGS=-g -O2 set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\EMPTIN~1\AppData\Local\Temp\go-build411590906=/tmp/go-build -gno-record-gcc-switches

</pre></details>

What did you do?

Run go test ./test/... -cover. Unit Tests coverage shows the statement: coverage: [no statements]

The following test code is a sample:

KctuAoErhfs.txt

package playpen_test

import (
	"testing"
)

func Sum(numbers []int) int {
	sum := 0
	for _, number := range numbers {
		sum += number
	}
	return sum
}

func TestSum(t *testing.T) {

	t.Run("collection of any size", func(t *testing.T) {
		numbers := []int{1, 2, 3}

		got := Sum(numbers)
		want := 6

		if got != want {
			t.Errorf("got %d want %d given, %v", got, want, numbers)
		}
	})
}

What did you expect to see?

Showing the test coverage as per the example in https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/arrays-and-slices

What did you see instead?

Have the following shown instead Capture

or in text: ok go-programming/test/arrays 0.200s coverage: [no statements]

closed time in 7 days

NickBishop2112

issue commentgolang/go

cmd/go: consider including Go's own version in 'go env'

We could close the not-quite-semver gap a little bit by using - instead of + to separate the hash: then it would read as a SemVer prefix with a pre-release suffix, which seems like not a terrible fit for the intended meaning.

mvdan

comment created time in 7 days

issue commentgolang/go

proposal: path/filepath: add WalkDir (Walk using DirEntry)

I think the vast majority of WalkFunc implementations are going to do something along the lines of:

	if err != nil {
		log.Print(err)
		return nil
	}

or equivalent, or

	if err != nil {
		return err
	}

right at the beginning.

For the latter functions, the second call for a ReadDir error seems fine: it potentially does a little more work up-front for directories that are probably just going to waste, but errors are unusual so that's no big deal.

For the former functions — the ones that just log.Print and carry on — it's also no big deal. They'll produce a little more output, but they seem intended to produce best-effort output anyway.

The only WalkFuncs that will have a problem are the ones that don't return at all in case of a non-nil error and are also not idempotent for a given input. But I suspect that those are rare compared to functions that return and functions that are idempotent (such as those that aggregate into a map).

rsc

comment created time in 7 days

issue commentgolang/go

doc: introduce a page for CI best practices

CC @stevetraut

mvdan

comment created time in 7 days

issue commentgolang/go

proposal: add illustrations to documentation pages

@yiyus, @heschik points out that a convention like “See figure <file> (<alt-text>).” might be challenging for authors of non-English documentation.

We have a similar precedent in the // Deprecated: comments for APIs and // Output: comments for Example functions, so perhaps the format here could be something like // Image: <file> (<alt-text>).

ajstarks

comment created time in 7 days

issue commentgolang/go

proposal: add ios/amd64 as a GOOS/GOARCH

(Note that I am distinguishing here between “a configuration that we support” and “a configuration that happens to work today”.)

aclements

comment created time in 7 days

issue commentgolang/go

proposal: add ios/amd64 as a GOOS/GOARCH

I guess part of what I'm saying is: if this is a configuration that we “already kind of support”, then we need a builder (regardless of whether it is GOOS=ios or GOOS=darwin -tags=ios) to ensure that that configuration doesn't regress.

aclements

comment created time in 7 days

issue commentgolang/go

cmd/go/internal/fsys: TestWalk fails on Plan 9

Given your argument above, I suppose that the Lstat behavior on Plan 9 is correct and it is the other platforms that are not quite right.

Hrm. The stat(1) command on Linux is consistent with Go's Stat and Lstat:

$ cd /tmp
/tmp$ stat . --format=%n
.

I guess this is just a plain old platform variation. 😞

millerresearch

comment created time in 8 days

issue commentgolang/go

cmd/go/internal/fsys: TestWalk fails on Plan 9

Hmm. On other systems, there is one obvious base name to choose for ., which is the name given by calling filepath.Base on the result of os.Getwd(). But they don't do that today. 😞

Given your argument above, I suppose that the Lstat behavior on Plan 9 is correct and it is the other platforms that are not quite right.

millerresearch

comment created time in 8 days

issue commentgolang/go

proposal: add ios/amd64 as a GOOS/GOARCH

Is it possible to add a builder running the iOS emulator?

Per the porting policy, each port must have a builder with a designated maintainer. (We've run into issues in the past with regressions in otherwise-unsupported emulators, particularly QEMU user mode.)

aclements

comment created time in 8 days

issue commentgolang/go

cmd/go/internal/fsys: TestWalk fails on Plan 9

What does the program in https://play.golang.org/p/OHAkKG-4Tp- output when run on Plan 9?

(I can't run it myself due to #42117.)

millerresearch

comment created time in 8 days

issue openedgolang/go

x/build: "gomote ssh" to plan9-386 instance fails due to a "drawterm" loading error

~/go-review/src$ go version
go version devel +9848e93cb7 Wed Oct 21 09:34:39 2020 +0000 linux/amd64

~/go-review/src$ go version -m $(which gomote)
/usr/local/google/home/bcmills/bin/gomote: devel +1f48afe8db Fri Oct 16 14:26:34 2020 -0400
        path    golang.org/x/build/cmd/gomote
        mod     golang.org/x/build      (devel)
        dep     cloud.google.com/go     v0.54.0 h1:3ithwDMr7/3vpAMXiH+ZQnYbuIsh+OPhUPMFC9enmn0=
        dep     github.com/aws/aws-sdk-go       v1.30.15        h1:Sd8QDVzzE8Sl+xNccmdj0HwMrFowv6uVUx9tGsCE1ZE=
        dep     github.com/golang/groupcache    v0.0.0-20200121045136-8c9f03a8e57e      h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY=
        dep     github.com/golang/protobuf      v1.3.4  h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk=
        dep     github.com/googleapis/gax-go/v2 v2.0.5  h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=
        dep     github.com/jmespath/go-jmespath v0.3.0  h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc=
        dep     go.opencensus.io        v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8=
        dep     golang.org/x/net        v0.0.0-20200301022130-244492dfa37a      h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0=
        dep     golang.org/x/oauth2     v0.0.0-20200107190931-bf48bf16ab8d      h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=
        dep     golang.org/x/sync       v0.0.0-20190911185100-cd5d95a43a6e      h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
        dep     golang.org/x/sys        v0.0.0-20200302150141-5c8b2ff67527      h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=
        dep     golang.org/x/text       v0.3.2  h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
        dep     google.golang.org/api   v0.20.0 h1:jz2KixHX7EcCPiQrySzPdnYT7DbINAypCqKZ1Z7GM40=
        dep     google.golang.org/genproto      v0.0.0-20200305110556-506484158171      h1:xes2Q2k+d/+YNXVw0FpZkIDJiaux4OVrRKXRAzH6A0U=
        dep     google.golang.org/grpc  v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk=
        dep     gopkg.in/inf.v0 v0.9.1  h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=

~/go-review/src$ gomote ssh user-bcmills-plan9-386-0
$ ssh -p 2222 user-bcmills-plan9-386-0@farmer.golang.org # auth using https://github.com/bcmills.keys
Enter passphrase for key '/usr/local/google/home/bcmills/.ssh/id_rsa':
# Welcome to the gomote ssh proxy, bcmills.
# Connecting to/starting remote ssh...
#
# `gomote push` and the builders use:
# - workdir: /tmp/workdir
# - GOROOT: /tmp/workdir/go
# - GOPATH: /tmp/workdir/gopath
# - env: GO_BUILDER_NAME=plan9-386 GO_TEST_TIMEOUT_SCALE=3
# Happy debugging.
# Plan9 user/pass: glenda/glenda123
/usr/local/bin/drawterm: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory
Connection to farmer.golang.org closed.

CC @0intro @millerresearch @fhs @golang/release

created time in 8 days

issue commentgolang/go

cmd/go/internal/fsys: TestWalk fails on Plan 9

This appears to be due to a difference in the behavior of os.Lstat on Plan 9.

On other platforms, os.Lstat(".") empirically returns a FileInfo such that fi.Name() == ".", but on Plan 9 it seems to instead return the resolved name of the current working directory.

Is that difference intentional?

millerresearch

comment created time in 8 days

issue commentgolang/go

cmd/go: add option to prevent 'go get -u' from updating certain dependencies

I think the best fit for this use-case is a special version query. upgrade already means “current selected version or higher”, and patch means “current selected version or higher but within the same minor version”; the logical progression of those is some third token (maybe current?) meaning “current selected version and no higher”.

jayconrod

comment created time in 8 days

issue commentgolang/go

cmd/go: go get -u fails with local-only replacements

I believe this is fixed as of https://golang.org/cl/258220.

@kenichi-fukushima, please try a go command built from head (either by following the instructions at https://golang.org/doc/install/source or using golang.org/dl/gotip) and let us know if it still isn't working for you.

kenichi-fukushima

comment created time in 8 days

issue commentgolang/go

cmd/go/internal/renameio: TestConcurrentReadsAndWrites flaky on ios-arm64-corellium builder

Unmarking as release-blocker because the mitigation is in: the test is likely still flaky but the rate should be low enough not to interfere with building releases.

bcmills

comment created time in 8 days

issue commentgolang/go

x/build/cmd/updatestd: investigate (at an appropriate time) a package-first update strategy, instead of module-first

We have had other requests for a go list flag to ignore build constraints (from @dominikh and a few others, IIRC). I suspect that we will end up needing to support such a flag in cmd/go at some point anyway.

dmitshur

comment created time in 8 days

issue openedgolang/go

x/tools/gopls: suggests completion 'nilfunc' instead of 'nil' when module requires golang.org/x/tools

example.com$ go version
go version devel +55b2d479d Tue Oct 20 08:08:15 2020 +0000 linux/amd64

example.com$ ls -d ~/.emacs.d/elpa/eglot*
/usr/local/google/home/bcmills/.emacs.d/elpa/eglot-20200830.1254

example.com$ go version -m $(which gopls)
/usr/local/google/home/bcmills/bin/gopls: devel +186f0220d0 Mon Oct 5 11:12:24 2020 -0400
        path    golang.org/x/tools/gopls
        mod     golang.org/x/tools/gopls        v0.5.1  h1:AF3Uh7HF08SZpKFfgJO6zfF3bbxyDXWqdkK4kMXiQ1o=
        dep     github.com/BurntSushi/toml      v0.3.1  h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
        dep     github.com/google/go-cmp        v0.5.1  h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=
        dep     github.com/sergi/go-diff        v1.1.0  h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
        dep     golang.org/x/mod        v0.3.0  h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
        dep     golang.org/x/sync       v0.0.0-20200625203802-6e8e738ad208      h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=
        dep     golang.org/x/tools      v0.0.0-20200930165741-f1523d29dbb9      h1:1R38tQp22dcHpTKJPjgVa16FhlDy/kHEaCM/ndi/FIc=
        dep     golang.org/x/xerrors    v0.0.0-20200804184101-5ec99f83aff1      h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
        dep     honnef.co/go/tools      v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=
        dep     mvdan.cc/gofumpt        v0.0.0-20200802201014-ab5a8192947d      h1:t8TAw9WgTLghti7RYkpPmqk4JtQ3+wcP5GgZqgWeWLQ=
        dep     mvdan.cc/xurls/v2       v2.2.0  h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=

example.com$

Steps to reproduce

$ go mod init example.com
go: creating new go.mod: module example.com

$ go get -d golang.org/x/tools
go: downloading golang.org/x/tools v0.0.0-20201020141929-90550980fc82
go: golang.org/x/tools upgrade => v0.0.0-20201020141929-90550980fc82

example.com$ cat > example.go
package example

func F() interface{} {
}

$ emacs example.go

Now move the cursor to the function body, type return nil, and wait for completions.

Expected

nil is the obvious thing to return from a func interface{}, so it should be the first completion.

Observed

The first completion returned by gopls is the package golang.org/x/tools/go/analysis/passes/nilfunc. 😞

<details>

[Trace - 11:45:39.152 AM] Sending request 'initialize - (1)'.
Params: {"processId":9779,"rootPath":"/tmp/tmp.UF2AKOuMKI/example.com/","rootUri":"file:///tmp/tmp.UF2AKOuMKI/example.com/","initializationOptions":null,"capabilities":{"workspace":{"applyEdit":true,"executeCommand":{"dynamicRegistration":false},"workspaceEdit":{"documentChanges":false},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":false},"configuration":true},"textDocument":{"synchronization":{"dynamicRegistration":false,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":false,"completionItem":{"snippetSupport":true},"contextSupport":true},"hover":{"dynamicRegistration":false,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":false,"signatureInformation":{"parameterInformation":{"labelOffsetSupport":true}}},"references":{"dynamicRegistration":false},"definition":{"dynamicRegistration":false},"declaration":{"dynamicRegistration":false},"implementation":{"dynamicRegistration":false},"typeDefinition":{"dynamicRegistration":false},"documentSymbol":{"dynamicRegistration":false,"hierarchicalDocumentSymbolSupport":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"documentHighlight":{"dynamicRegistration":false},"codeAction":{"dynamicRegistration":false,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"formatting":{"dynamicRegistration":false},"rangeFormatting":{"dynamicRegistration":false},"rename":{"dynamicRegistration":false},"publishDiagnostics":{"relatedInformation":false}},"experimental":null}}


[Trace - 11:45:39.153 AM] Received response 'initialize - (1)' in 1ms.
Result: {"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":["."]},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor.extract","refactor.rewrite","source.fixAll","source.organizeImports"]},"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":""},"renameProvider":true,"foldingRangeProvider":true,"executeCommandProvider":{"commands":["generate","fill_struct","regenerate_cgo","test","tidy","undeclared_name","upgrade_dependency","vendor","extract_variable","extract_function","gc_details","generate_gopls_mod"]},"callHierarchyProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorkspaceFolders"}}},"serverInfo":{"name":"gopls","version":"Build info\n----------\ngolang.org/x/tools/gopls v0.5.1\n    golang.org/x/tools/gopls@v0.5.1 h1:AF3Uh7HF08SZpKFfgJO6zfF3bbxyDXWqdkK4kMXiQ1o=\n    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=\n    github.com/google/go-cmp@v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=\n    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=\n    golang.org/x/mod@v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=\n    golang.org/x/sync@v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=\n    golang.org/x/tools@v0.0.0-20200930165741-f1523d29dbb9 h1:1R38tQp22dcHpTKJPjgVa16FhlDy/kHEaCM/ndi/FIc=\n    golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=\n    honnef.co/go/tools@v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=\n    mvdan.cc/gofumpt@v0.0.0-20200802201014-ab5a8192947d h1:t8TAw9WgTLghti7RYkpPmqk4JtQ3+wcP5GgZqgWeWLQ=\n    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=\n"}}


[Trace - 11:45:39.154 AM] Sending notification 'initialized'.
Params: {}


[Trace - 11:45:39.155 AM] Received notification 'window/showMessage'.
Params: {"type":4,"message":"Loading packages..."}


[Trace - 11:45:39.155 AM] Received request 'workspace/configuration - (1)'.
Params: {"items":[{"scopeUri":"file:///tmp/tmp.UF2AKOuMKI/example.com/","section":"gopls"},{"scopeUri":"file:///tmp/tmp.UF2AKOuMKI/example.com/","section":"gopls-example.com"}]}


[Trace - 11:45:39.155 AM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go","version":0,"languageId":"go","text":"package example\n\nfunc F() interface{} {\n}\n"}}


[Trace - 11:45:39.156 AM] Sending notification 'workspace/didChangeConfiguration'.
Params: {"settings":{"gopls":{"staticcheck":true,"matcher":"CaseSensitive"}}}


[Trace - 11:45:39.156 AM] Sending request 'textDocument/documentSymbol - (2)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go"}}


[Trace - 11:45:39.161 AM] Sending response 'workspace/configuration - (1)' in 6ms.
Result: [{"staticcheck":true,"matcher":"CaseSensitive"},null]


[Trace - 11:45:39.197 AM] Received request 'client/registerCapability - (2)'.
Params: {"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{go,mod,sum}","kind":7},{"globPattern":"/tmp/tmp.UF2AKOuMKI/example.com/**/*.{go,mod,sum}","kind":7}]}}]}


[Trace - 11:45:39.198 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/10/20 11:45:39 go env for /tmp/tmp.UF2AKOuMKI/example.com/\n(root /tmp/tmp.UF2AKOuMKI/example.com)\n(go version go version devel +55b2d479d Tue Oct 20 08:08:15 2020 +0000 linux/amd64\n)\n(valid build configuration = true)\n(build flags: [])\nGO111MODULE=auto\nGOFLAGS=\nGOMOD=/tmp/tmp.UF2AKOuMKI/example.com/go.mod\nGONOPROXY=\nGOPATH=/tmp/tmp.UF2AKOuMKI/_gopath\nGOINSECURE=\nGOSUMDB=sum.golang.org\nGONOSUMDB=\nGOPRIVATE=\nGOCACHE=/usr/local/google/home/bcmills/.cache/go-build\nGOMODCACHE=/tmp/tmp.UF2AKOuMKI/_gopath/pkg/mod\nGOPROXY=https://proxy.golang.org,direct\nGOROOT=/usr/local/google/home/bcmills/sdk/gotip\n\n"}


[Trace - 11:45:39.199 AM] Sending response 'client/registerCapability - (2)' in 1ms.
Result: 


[Trace - 11:45:39.295 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/10/20 11:45:39 go/packages.Load\n\tsnapshot=0\n\tdirectory=/tmp/tmp.UF2AKOuMKI/example.com\n\tquery=[./... builtin]\n\tpackages=2\n"}


[Trace - 11:45:39.295 AM] Received notification 'window/showMessage'.
Params: {"type":3,"message":"Finished loading packages."}


[Trace - 11:45:39.296 AM] Received request 'workspace/configuration - (3)'.
Params: {"items":[{"scopeUri":"file:///tmp/tmp.UF2AKOuMKI/example.com/","section":"gopls"},{"scopeUri":"file:///tmp/tmp.UF2AKOuMKI/example.com/","section":"gopls-example.com"}]}


[Trace - 11:45:39.304 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/go.mod","diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":61}},"severity":2,"source":"go mod tidy","message":"golang.org/x/tools is not used in this module"}]}


[Trace - 11:45:39.305 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go","diagnostics":[{"range":{"start":{"line":3,"character":0},"end":{"line":3,"character":1}},"severity":1,"source":"compiler","message":"missing return"}]}


[Trace - 11:45:39.319 AM] Sending response 'workspace/configuration - (3)' in 23ms.
Result: [{"staticcheck":true,"matcher":"CaseSensitive"},null]


[Trace - 11:45:39.319 AM] Received response 'textDocument/documentSymbol - (2)' in 162ms.
Result: [{"name":"F","detail":"()","kind":12,"range":{"start":{"line":2,"character":0},"end":{"line":3,"character":1}},"selectionRange":{"start":{"line":2,"character":5},"end":{"line":2,"character":6}}}]


[Trace - 11:45:57.507 AM] Sending request 'textDocument/signatureHelp - (3)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go"},"position":{"line":2,"character":22}}


[Trace - 11:45:57.508 AM] Received response 'textDocument/signatureHelp - (3)' in 0ms.
Result: null


[Trace - 11:45:57.508 AM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/10/20 11:45:57 no signature help: cannot find an enclosing function\n\tposition={2 22}\n"}


[Trace - 11:45:57.508 AM] Sending request 'textDocument/hover - (4)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go"},"position":{"line":2,"character":22}}


[Trace - 11:45:57.509 AM] Received response 'textDocument/hover - (4)' in 0ms.
Result: null


[Trace - 11:45:57.509 AM] Sending request 'textDocument/documentHighlight - (5)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go"},"position":{"line":2,"character":22}}


[Trace - 11:45:57.510 AM] Received response 'textDocument/documentHighlight - (5)' in 0ms.
Result: []


[Trace - 11:45:58.058 AM] Sending notification 'textDocument/didChange'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go","version":2},"contentChanges":[{"range":{"start":{"line":2,"character":22},"end":{"line":2,"character":22}},"rangeLength":0,"text":"\n"},{"range":{"start":{"line":3,"character":0},"end":{"line":3,"character":0}},"rangeLength":0,"text":"\t"}]}


[Trace - 11:45:58.059 AM] Sending request 'textDocument/signatureHelp - (6)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go"},"position":{"line":3,"character":1}}


[Trace - 11:45:58.059 AM] Sending request 'textDocument/hover - (7)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go"},"position":{"line":3,"character":1}}


[Trace - 11:45:58.059 AM] Received response 'textDocument/signatureHelp - (6)' in 0ms.
Result: null


[Trace - 11:45:58.060 AM] Received response 'textDocument/hover - (7)' in 0ms.
Result: null


[Trace - 11:45:58.060 AM] Sending request 'textDocument/documentHighlight - (8)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go"},"position":{"line":3,"character":1}}


[Trace - 11:45:58.060 AM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/10/20 11:45:58 no signature help: cannot find an enclosing function\n\tposition={3 1}\n"}


[Trace - 11:45:58.060 AM] Received response 'textDocument/documentHighlight - (8)' in 0ms.
Result: []


[Trace - 11:45:58.060 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go","version":2,"diagnostics":[{"range":{"start":{"line":4,"character":0},"end":{"line":4,"character":1}},"severity":1,"source":"compiler","message":"missing return"}]}


[Trace - 11:46:00.130 AM] Sending notification 'textDocument/didChange'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go","version":12},"contentChanges":[{"range":{"start":{"line":3,"character":1},"end":{"line":3,"character":1}},"rangeLength":0,"text":"r"},{"range":{"start":{"line":3,"character":2},"end":{"line":3,"character":2}},"rangeLength":0,"text":"e"},{"range":{"start":{"line":3,"character":3},"end":{"line":3,"character":3}},"rangeLength":0,"text":"t"},{"range":{"start":{"line":3,"character":4},"end":{"line":3,"character":4}},"rangeLength":0,"text":"u"},{"range":{"start":{"line":3,"character":5},"end":{"line":3,"character":5}},"rangeLength":0,"text":"r"},{"range":{"start":{"line":3,"character":6},"end":{"line":3,"character":6}},"rangeLength":0,"text":"n"},{"range":{"start":{"line":3,"character":7},"end":{"line":3,"character":7}},"rangeLength":0,"text":" "},{"range":{"start":{"line":3,"character":8},"end":{"line":3,"character":8}},"rangeLength":0,"text":"n"},{"range":{"start":{"line":3,"character":9},"end":{"line":3,"character":9}},"rangeLength":0,"text":"i"},{"range":{"start":{"line":3,"character":10},"end":{"line":3,"character":10}},"rangeLength":0,"text":"l"}]}


[Trace - 11:46:00.132 AM] Sending request 'textDocument/completion - (9)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go"},"position":{"line":3,"character":11},"context":{"triggerKind":1}}


[Trace - 11:46:00.133 AM] Sending request 'textDocument/signatureHelp - (10)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go"},"position":{"line":3,"character":11}}


[Trace - 11:46:00.134 AM] Sending request 'textDocument/hover - (11)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go"},"position":{"line":3,"character":11}}


[Trace - 11:46:00.135 AM] Sending request 'textDocument/documentHighlight - (12)'.
Params: {"textDocument":{"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go"},"position":{"line":3,"character":11}}


[Trace - 11:46:00.137 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///tmp/tmp.UF2AKOuMKI/example.com/example.go","version":12,"diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":15}},"severity":2,"source":"ST1000","message":"at least one file in a package should have a package comment"}]}


[Trace - 11:46:00.168 AM] Received response 'textDocument/completion - (9)' in 36ms.
Result: {"isIncomplete":true,"items":[{"label":"nilfunc","kind":9,"detail":"\"golang.org/x/tools/go/analysis/passes/nilfunc\"","preselect":true,"sortText":"00000","filterText":"nilfunc","insertTextFormat":2,"textEdit":{"range":{"start":{"line":3,"character":8},"end":{"line":3,"character":11}},"newText":"nilfunc"},"additionalTextEdits":[{"range":{"start":{"line":1,"character":0},"end":{"line":1,"character":0}},"newText":"\nimport \"golang.org/x/tools/go/analysis/passes/nilfunc\"\n"}]},{"label":"nilness","kind":9,"detail":"\"golang.org/x/tools/go/analysis/passes/nilness\"","sortText":"00001","filterText":"nilness","insertTextFormat":2,"textEdit":{"range":{"start":{"line":3,"character":8},"end":{"line":3,"character":11}},"newText":"nilness"},"additionalTextEdits":[{"range":{"start":{"line":1,"character":0},"end":{"line":1,"character":0}},"newText":"\nimport \"golang.org/x/tools/go/analysis/passes/nilness\"\n"}]},{"label":"nil","kind":6,"sortText":"00002","filterText":"nil","insertTextFormat":2,"textEdit":{"range":{"start":{"line":3,"character":8},"end":{"line":3,"character":11}},"newText":"nil"}}]}


[Trace - 11:46:00.169 AM] Received response 'textDocument/signatureHelp - (10)' in 35ms.
Result: null


[Trace - 11:46:00.169 AM] Received notification 'window/logMessage'.
Params: {"type":1,"message":"2020/10/20 11:46:00 no signature help: cannot find an enclosing function\n\tposition={3 11}\n"}


[Trace - 11:46:00.169 AM] Received response 'textDocument/hover - (11)' in 35ms.
Result: {"contents":{"kind":"markdown","value":"```go\nnil\n```"},"range":{"start":{"line":3,"character":8},"end":{"line":3,"character":11}}}


[Trace - 11:46:00.170 AM] Received response 'textDocument/documentHighlight - (12)' in 34ms.
Result: [{"range":{"start":{"line":2,"character":9},"end":{"line":2,"character":20}},"kind":1},{"range":{"start":{"line":3,"character":8},"end":{"line":3,"character":11}},"kind":1}]


[Trace - 11:46:30.169 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/10/20 11:46:30 background imports cache refresh starting\n"}


[Trace - 11:46:30.172 AM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/10/20 11:46:30 background refresh finished after 3.385517ms\n"}


</details>

CC @stamblerre @heschik

created time in 8 days

issue commentgolang/go

cmd/go: allow 'go mod vendor' to omit replaced modules

@shoenig, we don't have any specific plans to work on this. If this feature is important to you, some more detail on your use-case (especially the alternatives you considered and the problems with those alternatives) would be helpful.

At the moment, the big question is whether the added convenience is worth the added complexity (of both the implementation and the documentation).

mkeeler

comment created time in 9 days

issue commentgolang/go

cmd/go: 'go run' should run executables in module mode outside a module

Just to consider as an alternative:

example.com$ GOBIN=$(pwd) go install gioui.org/cmd/gogio@d5bdf0756a5a

example.com$ ./gogio
gogio: specify a package

That has its own problems (namely, $(pwd) is not portable), but it makes clear that for subsequent invocations the user should re-invoke the compiled binary rather than re-resolving and recompiling from upstream.

If we allowed go build to accept the @version syntax, then it could be made portable:

$ go build -o ./gogio.exe gioui.org/cmd/gogio@d5bdf0756a5a
$ ./gogio.exe
eliasnaur

comment created time in 9 days

issue openedgolang/go

runtime: TestCgoExecSignalMask failures due to apparent deadlock on *BSD

<details>

--- FAIL: TestCgoExecSignalMask (60.56s)
    crash_test.go:105: /tmp/workdir/tmp/go-build689039578/testprogcgo.exe CgoExecSignalMask exit status: exit status 2
    crash_cgo_test.go:160: expected "OK\n", got SIGQUIT: quit
        PC=0x46de03 m=8 sigcode=0
        
        goroutine 0 [idle]:
        runtime.lwp_park(0x3, 0x0, 0x0, 0xc000180340, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc000182180, ...)
        	/tmp/workdir/go/src/runtime/sys_netbsd_amd64.s:95 +0x23
        runtime.semasleep(0xffffffffffffffff, 0x0)
        	/tmp/workdir/go/src/runtime/os_netbsd.go:167 +0xb4
        runtime.notesleep(0xc000180150)
        	/tmp/workdir/go/src/runtime/lock_sema.go:181 +0xca
        runtime.stopm()
        	/tmp/workdir/go/src/runtime/proc.go:1948 +0xac
        runtime.findrunnable(0xc000027800, 0x0)
        	/tmp/workdir/go/src/runtime/proc.go:2509 +0xa7f
        runtime.schedule()
        	/tmp/workdir/go/src/runtime/proc.go:2712 +0x2d7
        runtime.mstart1()
        	/tmp/workdir/go/src/runtime/proc.go:1209 +0x93
        runtime.mstart()
        	/tmp/workdir/go/src/runtime/proc.go:1167 +0x6e
        
        goroutine 1 [semacquire]:
        sync.runtime_Semacquire(0xc000018318)
        	/tmp/workdir/go/src/runtime/sema.go:56 +0x45
        sync.(*WaitGroup).Wait(0xc000018310)
        	/tmp/workdir/go/src/sync/waitgroup.go:130 +0x65
        main.CgoExecSignalMask()
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:95 +0x15a
        main.main()
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/main.go:34 +0x1da
        
        goroutine 7 [syscall]:
        os/signal.signal_recv(0x58c820)
        	/tmp/workdir/go/src/runtime/sigqueue.go:147 +0x9d
        os/signal.loop()
        	/tmp/workdir/go/src/os/signal/signal_unix.go:23 +0x25
        created by os/signal.Notify.func1.1
        	/tmp/workdir/go/src/os/signal/signal.go:151 +0x45
        
        goroutine 8 [chan receive]:
        main.CgoExecSignalMask.func1(0xc00005a180)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:57 +0x47
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:56 +0xe7
        
        goroutine 9 [chan send]:
        os/signal.signal_enable(0xdcc5c2d10000001e)
        	/tmp/workdir/go/src/runtime/sigqueue.go:216 +0x72
        os/signal.enableSignal(...)
        	/tmp/workdir/go/src/os/signal/signal_unix.go:49
        os/signal.Notify.func1(0x1e)
        	/tmp/workdir/go/src/os/signal/signal.go:145 +0x88
        os/signal.Notify(0xc00008e060, 0xc000031fa8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:165 +0x162
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 10 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a480, 0xc00002a7a8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 11 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a540, 0xc00002afa8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 12 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a600, 0xc00002b7a8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 13 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a6c0, 0xc00002bfa8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 14 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a780, 0xc00002c7a8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 15 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a840, 0xc00002cfa8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 16 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a900, 0xc00002d7a8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 18 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0xc000032800, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Notify(0xc00005a9c0, 0xc00002dfa8, 0x1, 0x1)
        	/tmp/workdir/go/src/os/signal/signal.go:126 +0x235
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:70 +0xc5
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        goroutine 19 [semacquire]:
        sync.runtime_SemacquireMutex(0x84ad04, 0x1, 0x1)
        	/tmp/workdir/go/src/runtime/sema.go:71 +0x47
        sync.(*Mutex).lockSlow(0x84ad00)
        	/tmp/workdir/go/src/sync/mutex.go:138 +0x105
        sync.(*Mutex).Lock(...)
        	/tmp/workdir/go/src/sync/mutex.go:81
        os/signal.Stop(0xc00005a240)
        	/tmp/workdir/go/src/os/signal/signal.go:216 +0x375
        main.CgoExecSignalMask.func2(0xc000018310)
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:91 +0x139
        created by main.CgoExecSignalMask
        	/tmp/workdir/go/src/runtime/testdata/testprogcgo/exec.go:66 +0x13e
        
        rax    0x4
        rbx    0x0
        rcx    0x46de03
        rdx    0x0
        rdi    0x3
        rsi    0x0
        rbp    0x788302dffd60
        rsp    0x788302dffd08
        r8     0xc000180340
        r9     0xc000180340
        r10    0x0
        r11    0x202
        r12    0x3
        r13    0xc000182180
        r14    0x788304cde000
        r15    0x7883043fb000
        rip    0x46de03
        rflags 0x203
        cs     0x47
        fs     0x0
        gs     0x0
FAIL
FAIL	runtime	118.004s

</details>

2020-10-20T08:08:15-55b2d47/netbsd-amd64-9_0 2020-09-23T11:49:55-4d7abd7/freebsd-arm64-dmgk 2020-09-22T22:47:43-7f71846/freebsd-arm64-dmgk 2020-07-10T11:32:36-3a43226/netbsd-amd64-9_0 2020-05-01T05:25:54-e1d1684/freebsd-arm64-dmgk 2020-04-29T20:33:31-197a2a3/netbsd-amd64-9_0

Compare #38333.

CC @ianlancetaylor @cherrymui @aclements

created time in 9 days

issue openedgolang/go

x/sync/singleflight: occasional failures in TestForget

--- FAIL: TestForget (0.00s)
    singleflight_test.go:160: Third call should not be started because was started during second execution
    singleflight_test.go:163: We should receive result produced by second call, expected: 2, got 3
FAIL
FAIL	golang.org/x/sync/singleflight	61.958s

The failing test is the regression test added for #31420 (CC @cuonglm @bradfitz).

The bug appears to be in the test: https://github.com/golang/sync/blob/b3e1573b75205f2905c4b27986413d2e2be9803c/singleflight/singleflight_test.go#L153-L157

In that section, nothing guarantees that the second invocation is still running when g.Do is evaluated. (The second goroutine can complete immediately after close(secondCh), causing the third invocation to be evaluated.)

2020-10-08T14:14:35-b3e1573/android-386-emu 2019-09-11T18:51:00-cd5d95a/freebsd-amd64-race 2019-04-23T02:48:10-1122301/freebsd-amd64-race 2019-04-23T02:48:10-1122301/windows-amd64-race

created time in 9 days

issue openedgolang/go

x/build: no SlowBot for "linux-amd64-nocgo"

On https://golang.org/cl/263357, I repeatedly tried to trigger a nocgo SlowBot, and repeatedly failed to do so. (See the comment log there for details.)

I had thought that any builder at all could be triggered via a TRY= line, but now I'm not so sure. At the very least, it appears that the SlowBot configuration is missing a nocgo shorthand entry.

CC @golang/release

created time in 9 days

issue commentgolang/go

net: deadlock in TestDialParallelSpuriousConnection on darwin-arm*

CC @cherrymui

bcmills

comment created time in 9 days

issue commentgolang/go

net: deadlock in TestDialParallelSpuriousConnection on darwin-arm*

https://storage.googleapis.com/go-build-log/2ab992ae/ios-arm64-corellium_eb14298d.log

bcmills

comment created time in 9 days

issue commentgolang/go

runtime/race: cannot run under qemu-user-ppc64le due to execve /proc/self/exe

We currently lack a QEMU builder (#1508), and per http://golang.org/wiki/PortingPolicy, supported platforms require builders. Therefore, the QEMU platform is not supported.

tie

comment created time in 9 days

issue commentgolang/go

os/exec: TestContextCancel is flaky on netbsd-arm64-bsiegert builder

I would be inclined to eliminate the dependency on the grace time entirely.

That could be done fairly easily by swapping the goroutines: instead of calling io.WriteString on the test-function goroutine and stdout.Read in a background goroutine, I would call io.WriteString and cancel on the background goroutine and move the Read loop to the test function.

Then you just keep reading until EOF, and if EOF never comes the test crashes itself and you figure out what happened from the goroutine dump (which you'll probably need anyway, because if the test legitimately fails there's probably a deadlock somewhere in os/exec).

bcmills

comment created time in 9 days

issue commentgolang/go

cmd/go: allow replacement modules to alias other active modules

@Dragomir-Ivanov, no need to file a separate issue. This is next on my list after #36460, although it might not make 1.16 before the freeze.

However, note that github.com/globalsign/mgo imports packages from itself. The replace directives that you describe, if they were allowed today, would result in two distinct copies of each package (one beginning with github.com/globalsign/mgo, and one beginning with gopkg.in/mgo.v2), but with each copy importing only one other copy (presumably github.com/globalsign/mgo?).

That could well produce type errors if types from the imported packages are used in the exported API, since each distinct package also defines its own types.

It seems that what you ideally need is exactly what we haven't implemented yet, which is a way to reinterpret import statements that refer to one of those copies as if they instead referred to the other.

mwf

comment created time in 9 days

issue openedgolang/go

cmd/go/internal/renameio: TestConcurrentReadsAndWrites failure on ios-arm64-corellium builder

The ios-arm64-corellium builder seems to be affected by the same darwin kernel bug reported in #33041.

Perhaps we should expand the skip for that bug to also apply to ios-arm64-corellium, although it's not obvious to me how we could apply the skip to only the affected kernel.

CC @cherrymui @dmitshur

2020-10-17T00:26:52-a2eb53c/ios-arm64-corellium 2020-10-16T18:54:38-570b49d/ios-arm64-corellium 2020-10-12T17:23:06-1aa43a5/ios-arm64-corellium 2020-10-06T19:39:32-1fb149f/ios-arm64-corellium

created time in 10 days

issue openedgolang/go

net/http: TestTransportPersistConnLeak failure on plan9-386-0intro builder

2019-11-05T19:06:28-7e71c9c/plan9-386-0intro

http.test 1338092: warning: process exceeds 100 file descriptors
--- FAIL: TestTransportPersistConnLeak (2.96s)
    transport_test.go:1619: goroutine growth: 170 -> 322 -> 220 (delta: 50)
    transport_test.go:1620: too many new goroutines
2019/11/05 14:48:14 http: TLS handshake error from 127.0.0.1:55194: EOF
2019/11/05 14:48:14 http: TLS handshake error from 127.0.0.1:57366: EOF
FAIL
FAIL	net/http	114.358s

See previously #14887, #14375, #4822, #7237.

CC @0intro @millerresearch @fhs

created time in 10 days

issue commentgolang/go

proposal: cmd/go: add go test -skip to skip specific tests

@ChrisHines, I think the question is, would someone running go test -bench=BenchmarkFoo -skip=BenchmarkFoo/some_subbench expect it to skip BenchmarkFoo/some_subbench?

I would argue that pretty much everyone would expect that to skip the benchmark, so I suspect that a unified -skip flag would be less confusing than a separate -benchskip flag.

dprotaso

comment created time in 10 days

issue commentgolang/go

proposal: cmd/go: add go test -skip to skip specific tests

@magical, further complications in the syntax for the -skip flag would be pretty awkward for the “run a specific test but skip a specific subtest” use-case mentioned previously.

dprotaso

comment created time in 10 days

issue openedgolang/go

x/build/dashboard: openbsd-mips64-jsing inconsistently greyed out

The openbsd-mips64-jsing builder is greyed out on the dashboard for the main repo, and for the x/net repo in isolation. image

However, its entry is not greyed out for the x/net repo in the golang.org/x/ repos summary section, where it shows as a red failure. image

CC @golang/osp-team

created time in 10 days

issue commentgolang/go

x/net/route: TestRouteMessage failures on freebsd builders

2020-10-16T16:51:38-7b1cca2/freebsd-386-11_2 2020-10-09T03:24:41-dbdefad/freebsd-386-11_2 2020-10-06T15:34:59-a7d1128/freebsd-386-12_0 2020-09-30T14:50:03-4acb6c0/freebsd-386-11_2 2020-09-27T03:25:02-5d4f700/freebsd-386-11_2 2020-09-27T03:25:02-5d4f700/freebsd-386-12_0 2020-09-23T18:22:12-328152d/freebsd-386-11_2 2020-09-23T18:22:12-328152d/freebsd-386-12_0 2020-09-04T19:48:48-62affa3/freebsd-386-11_2 2020-09-04T19:48:48-62affa3/freebsd-386-12_0 2020-08-13T13:45:08-3edf25e/freebsd-386-11_2 2020-07-07T03:43:11-ab34263/freebsd-386-11_2 2020-07-07T03:43:11-ab34263/freebsd-386-12_0 2020-06-25T00:16:55-4c52546/freebsd-386-11_2 2020-06-25T00:16:55-4c52546/freebsd-386-12_0 2020-06-02T11:40:24-627f964/freebsd-386-11_2 2020-05-05T04:18:28-1ed2336/freebsd-386-12_0 2020-05-01T05:30:45-e0ff5e5/freebsd-386-11_2 2020-05-01T05:30:45-e0ff5e5/freebsd-386-12_0 2020-04-25T23:01:54-ff2c4b7/freebsd-386-11_2 2020-04-21T23:12:49-e086a09/freebsd-386-11_2 2020-03-24T14:37:07-d3edc99/freebsd-386-11_2 2020-03-01T02:21:30-244492d/freebsd-386-12_0 2020-02-26T12:10:28-0de0cce/freebsd-386-11_2 2020-02-22T12:55:58-5a598a2/freebsd-386-11_2 2019-12-06T10:30:17-1ddd1de/freebsd-386-12_0 2019-12-04T02:50:24-5ee1b9f/freebsd-386-11_2 2019-11-26T23:54:20-ef20fe5/freebsd-386-11_2 2019-11-25T08:49:36-ffdde10/freebsd-386-12_0 2019-11-19T07:31:36-fc4aabc/freebsd-386-11_2 2019-11-19T07:31:36-fc4aabc/freebsd-386-12_0 2019-11-18T18:34:10-d06c31c/freebsd-386-11_2 2019-11-18T18:34:10-d06c31c/freebsd-386-12_0 2019-11-16T16:09:21-f9c8255/freebsd-386-12_0

bcmills

comment created time in 10 days

issue commentgolang/go

runtime: lock ordering problem involving 'fin' and 'mheap'

Marking as release-blocker for Go 1.16 because it's a lock-ordering problem in the runtime.

(We should at least understand whether it's a missing lock annotation or a real potential deadlock prior to the 1.16 release.)

bcmills

comment created time in 10 days

issue openedgolang/go

runtime: lock ordering problem involving 'fin' and 'mheap'

https://build.golang.org/log/e77e304008e6ffb4bf722e8296e6a2e7621cd4ba

136026  ======
0 : fin 18 0x63b350
1 : mheap 38 0x620080
fatal error: lock ordering problem
…
136026  ======
0 : fin 18 0x63b350
1 : mheap 38 0x620080
2 : allg 11 0x63b2d0
fatal error: lock ordering problem

CC @danscales @mknyszek

<details>

136026  ======
0 : fin 18 0x63b350
1 : mheap 38 0x620080
fatal error: lock ordering problem

runtime stack:
runtime.throw(0x53cdcf, 0x15)
	/workdir/go/src/runtime/panic.go:1112 +0x72
runtime.checkRanks(0xc000082180, 0x12, 0x26)
	/workdir/go/src/runtime/lockrank_on.go:159 +0x10c
runtime.lockWithRankMayAcquire.func1()
	/workdir/go/src/runtime/lockrank_on.go:231 +0xac
runtime.lockWithRankMayAcquire(0x620080, 0x26)
	/workdir/go/src/runtime/lockrank_on.go:220 +0x7e
runtime.getempty(0x40c70f)
	/workdir/go/src/runtime/mgcwork.go:359 +0xa5
runtime.(*gcWork).init(0xc000023e98)
	/workdir/go/src/runtime/mgcwork.go:99 +0x25
runtime.(*gcWork).putBatch(0xc000023e98, 0xc000023ed0, 0x2, 0x200)
	/workdir/go/src/runtime/mgcwork.go:173 +0x19f
runtime.wbBufFlush1(0xc000022800)
	/workdir/go/src/runtime/mwbbuf.go:287 +0x237
runtime.wbBufFlush.func1()
	/workdir/go/src/runtime/mwbbuf.go:201 +0x3a
runtime.systemstack(0x0)
	/workdir/go/src/runtime/asm_amd64.s:370 +0x66
runtime.mstart()
	/workdir/go/src/runtime/proc.go:1146

goroutine 5 [running]:
runtime.systemstack_switch()
	/workdir/go/src/runtime/asm_amd64.s:330 fp=0xc00002e688 sp=0xc00002e680 pc=0x467040
runtime.wbBufFlush(0xc000080278, 0x543100)
	/workdir/go/src/runtime/mwbbuf.go:200 +0x47 fp=0xc00002e6a8 sp=0xc00002e688 pc=0x42fc47
runtime.gcWriteBarrier(0x437416, 0x542d10, 0xe000e000e, 0xc00002e7d0, 0x418b92, 0x543100, 0x63b350, 0xc000191410, 0x1, 0xc00002e7d0, ...)
	/workdir/go/src/runtime/asm_amd64.s:1463 +0xae fp=0xc00002e730 sp=0xc00002e6a8 pc=0x468e0e
runtime.gcWriteBarrierDX(0x542d10, 0xe000e000e, 0xc00002e7d0, 0x418b92, 0x543100, 0x63b350, 0xc000191410, 0x1, 0xc00002e7d0, 0x436f75, ...)
	/workdir/go/src/runtime/asm_amd64.s:1490 +0x7 fp=0xc00002e738 sp=0xc00002e730 pc=0x468e87
runtime.gopark(0x543100, 0x63b350, 0xc000191410, 0x1)
	/workdir/go/src/runtime/proc.go:325 +0x116 fp=0xc00002e758 sp=0xc00002e738 pc=0x437416
runtime.goparkunlock(...)
	/workdir/go/src/runtime/proc.go:337
runtime.runfinq()
	/workdir/go/src/runtime/mfinal.go:175 +0xb2 fp=0xc00002e7e0 sp=0xc00002e758 pc=0x418b92
runtime.goexit()
	/workdir/go/src/runtime/asm_amd64.s:1376 +0x1 fp=0xc00002e7e8 sp=0xc00002e7e0 pc=0x468d41
created by runtime.createfing
	/workdir/go/src/runtime/mfinal.go:156 +0x65
136026  ======
0 : fin 18 0x63b350
1 : mheap 38 0x620080
2 : allg 11 0x63b2d0
fatal error: lock ordering problem
panic during panic

runtime stack:
runtime.throw(0x53cdcf, 0x15)
	/workdir/go/src/runtime/panic.go:1112 +0x72
runtime.checkRanks(0xc000082180, 0x26, 0xb)
	/workdir/go/src/runtime/lockrank_on.go:159 +0x10c
runtime.lockWithRank.func1()
	/workdir/go/src/runtime/lockrank_on.go:87 +0xbc
runtime.lockWithRank(0x63b2d0, 0xb)
	/workdir/go/src/runtime/lockrank_on.go:76 +0xa5
runtime.lock(...)
	/workdir/go/src/runtime/lock_futex.go:47
runtime.tracebackothers(0xc000082180)
	/workdir/go/src/runtime/traceback.go:917 +0x93
runtime.dopanic_m(0xc000082180, 0x434752, 0xc000091de0, 0x1)
	/workdir/go/src/runtime/panic.go:1312 +0x2c9
runtime.fatalthrow.func1()
	/workdir/go/src/runtime/panic.go:1167 +0x5f
runtime.fatalthrow()
	/workdir/go/src/runtime/panic.go:1164 +0x57
runtime.throw(0x53cdcf, 0x15)
	/workdir/go/src/runtime/panic.go:1112 +0x72
runtime.checkRanks(0xc000082180, 0x12, 0x26)
	/workdir/go/src/runtime/lockrank_on.go:159 +0x10c
runtime.lockWithRankMayAcquire.func1()
	/workdir/go/src/runtime/lockrank_on.go:231 +0xac
runtime.lockWithRankMayAcquire(0x620080, 0x26)
	/workdir/go/src/runtime/lockrank_on.go:220 +0x7e
runtime.getempty(0x40c70f)
	/workdir/go/src/runtime/mgcwork.go:359 +0xa5
runtime.(*gcWork).init(0xc000023e98)
	/workdir/go/src/runtime/mgcwork.go:99 +0x25
runtime.(*gcWork).putBatch(0xc000023e98, 0xc000023ed0, 0x2, 0x200)
	/workdir/go/src/runtime/mgcwork.go:173 +0x19f
runtime.wbBufFlush1(0xc000022800)
	/workdir/go/src/runtime/mwbbuf.go:287 +0x237
runtime.wbBufFlush.func1()
	/workdir/go/src/runtime/mwbbuf.go:201 +0x3a
runtime.systemstack(0x0)
	/workdir/go/src/runtime/asm_amd64.s:370 +0x66
runtime.mstart()
	/workdir/go/src/runtime/proc.go:1146

</details>

created time in 10 days

issue openedgolang/go

os/exec: TestContextCancel is flaky on netbsd-arm64-bsiegert builder

2020-10-18T08:22:01-515e6a9/netbsd-arm64-bsiegert 2020-10-16T03:02:36-912262b/netbsd-arm64-bsiegert 2020-10-14T15:19:28-52669c4/netbsd-arm64-bsiegert 2020-10-12T21:13:04-15a11ce/netbsd-arm64-bsiegert 2020-10-07T20:18:35-ade5161/netbsd-arm64-bsiegert 2020-10-06T22:56:00-f8e5540/netbsd-arm64-bsiegert 2020-10-06T21:55:49-2e4ceaf/netbsd-arm64-bsiegert

It looks like the test hard-codes a 1-second timeout on the cancellation terminating the child process. That might not be a reasonable assumption on slow, heavily-loaded builders. https://github.com/golang/go/blob/f8df205e74d5122c43f41923280451641e566ee2/src/os/exec/exec_test.go#L1081-L1083

CC @bsiegert @bradfitz @ianlancetaylor

created time in 10 days

issue commentgolang/go

build: add noopt trybot

Also CL 263097.

josharian

comment created time in 10 days

issue commentdominikh/go-tools

staticcheck: flag static conditions

In this case, there is one more piece of signal that we could use to weed out false-positives: the constant-valued variable (added) does not immediately precede the condition — there is an entire for-loop in between.

bcmills

comment created time in 12 days

issue openeddominikh/go-tools

false negative for an if-condition that is always true

The code: https://golang.org/cl/258220, file src/cmd/go/internal/modload/query.go, line 918.

The problem: I accidentally deleted the only assignment to the added variable (adjacent to line 913). As a result, the condition at line 918 is always true, and the code from 922–931 is statically dead. (That code is important for correctness: it is what sorts the returned slice, and the contract for the Versions method requires the slice to be sorted.)

For comparison, the fix for the undetected bug is in https://golang.org/cl/263266.

Diagnostic information:

~/go-review/src$ go version
go version devel +11cfb48df1 Sat Oct 17 00:32:32 2020 +0000 linux/amd64

~/go-review/src$ staticcheck -version
staticcheck 2020.1.3

~/go-review/src$ staticcheck -debug.version
staticcheck 2020.1.3

Compiled with Go version: devel +b553df8527 Tue Feb 25 12:04:38 2020 -0500
Main module:
        honnef.co/go/tools@v0.0.1-2020.1.3 (sum: h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U=)
Dependencies:
        github.com/BurntSushi/toml@v0.3.1 (sum: h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=)
        golang.org/x/tools@v0.0.0-20191130070609-6e064ea0cf2d (sum: h1:/iIZNFGxc/a7C3yWjGcnboV+Tkc7mxr+p6fDztwoxuM=)

~/go-review/src$ go version
go version devel +11cfb48df1 Sat Oct 17 00:32:32 2020 +0000 linux/amd64

~/go-review/src$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/usr/local/google/home/bcmills/.cache/go-build"
GOENV="/usr/local/google/home/bcmills/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/usr/local/google/home/bcmills/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/usr/local/google/home/bcmills"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/google/home/bcmills/go-review"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/google/home/bcmills/go-review/pkg/tool/linux_amd64"
GCCGO="/usr/local/google/home/bcmills/bin/gccgo"
AR="ar"
CC="gcc"
CXX="c++"
CGO_ENABLED="1"
GOMOD="/usr/local/google/home/bcmills/go-review/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build452785350=/tmp/go-build -gno-record-gcc-switches"

~/go-review/src$ staticcheck cmd/go/internal/modload
cmd/go/internal/modload/init.go:794:13: error strings should not end with punctuation or a newline (ST1005)
cmd/go/internal/modload/load.go:102:2: package "path" is being imported more than once (ST1019)
        cmd/go/internal/modload/load.go:103:2: other import of "path"
cmd/go/internal/modload/mvs.go:113:17: func (*mvsReqs).next is unused (U1000)
cmd/go/internal/modload/query.go:652:6: type prefixResult is unused (U1000)
cmd/go/internal/modload/query.go:902:10: unnecessary assignment to the blank identifier (S1005)
cmd/go/internal/modload/search.go:173:2: redundant return statement (S1023)
cmd/go/internal/modload/stat_unix.go:20:6: func hasWritePerm is unused (U1000)
cmd/go/internal/modload/vendor.go:85:13: empty branch (SA9003)

~/go-review/src$

created time in 12 days

issue commentgolang/go

proposal: os: add ReadDir, ReadFile, WriteFile, CreateTemp, MkdirTemp & deprecate io/ioutil

Actually, even MkdirTemp and CreateTemp could belong in io/fs, if we define an FS extension interface for a method that returns a default directory for temporary files.

rsc

comment created time in 12 days

issue commentgolang/go

proposal: os: add ReadDir, ReadFile, WriteFile, CreateTemp, MkdirTemp & deprecate io/ioutil

(MkdirTemp and CreateTemp seem like they belong in os, though: the location of the temporary directory is OS-specific, and CreateTemp, at least, should return a *os.File rather than an abstract fs.File.)

rsc

comment created time in 12 days

issue commentgolang/go

proposal: os: add ReadDir, ReadFile, WriteFile, CreateTemp, MkdirTemp & deprecate io/ioutil

Would it make sense to put ReadDir, ReadFile, and WriteFile in io/fs instead of os? It sees like they could plausibly work with any filesystem, not just the os one.

I would argue that they fit naturally with the new Walk API, wherever that ends up: ReadDir, ReadFile, WriteFile, and Walk all share the property that they implement a high-level operation in terms of existing lower-level operations.

rsc

comment created time in 12 days

issue commentgolang/go

sum.golang.org: should not respond with "410 Gone"

the go command reported the "unexpected" error (despite it apparently being an expected and known error)

What was the error it gave you? Perhaps we can improve the error message somehow.

mpalmer

comment created time in 12 days

issue commentgolang/go

cmd/go: run constantly fails and suggests 'go mod tidy'

The go mod tidy suggestion from the original also suggests to me that there is an error in our inAll computation, possibly related to #37376.

myitcv

comment created time in 12 days

issue commentgolang/go

cmd/go: run constantly fails and suggests 'go mod tidy'

As of CL 258220, the error message is now:

$ go run blah.com
no required module provides package blah.com; try 'go get -d blah.com' to add it

If the replace directive specified some explicit version other than the latest one, that suggestion might fetch a version other than the intended one, but it's still much better than suggesting go mod tidy.

myitcv

comment created time in 12 days

issue commentgolang/go

cmd/go: panic in base.SetFromGOFLAGS

Yep. When hideErrors is false, InitGOFLAGS should report the invalid flags, so SetFromGOFLAGS can ignore invalid flags unconditionally. (Either the error has already been reported in InitGOFLAGS, or we don't care to report it at all.)

tie

comment created time in 12 days

issue commentgolang/go

cmd/go: should we reuse GOMODCACHE in TestScript?

Should we do the same with the new GOMODCACHE Go environment variable? That would let the tests share the host's module download cache.

The cmd/go tests use a local proxy, which we don't want to pollute the user's GOMODCACHE.

It would be possible, perhaps, to use a separate GOMODCACHE shared among the tests, except for a handful of tests that specifically check for caching behavior. (We didn't share the GOMODCACHE among tests initially in part due to #26794, which has long since been fixed.)

mvdan

comment created time in 12 days

issue commentgolang/go

proposal: io/fs, filepath: add more efficient Walk alternative

@jimmyfrasche, I would expect an error entering a directory to be possible due to a number of reasons, such as:

  • a permission error preventing the current user from listing the directory,
  • the entry not actually referring to a directory,
  • the entry being a directory on an unmounted filesystem, or on a networked filesystem for which a network error has occurred,
  • the entry being located in a corrupted sector of the disk
rsc

comment created time in 12 days

issue commentgolang/go

cmd/go: panic in base.SetFromGOFLAGS

@obeyda, sure! Start with a new test case replicating the panic in src/cmd/go/testdata/script.

tie

comment created time in 12 days

issue commentgolang/go

x/build/cmd/coordinator: improve error message when build fails due to a module not being tidy (and causing failed requests to sum.golang.org)

CL 262341 should substantially improve the error message generated by cmd/go.

dmitshur

comment created time in 12 days

issue commentgolang/go

cmd/go: panic in base.SetFromGOFLAGS

Neat find! Thanks for the report.

tie

comment created time in 13 days

issue commentgolang/go

proposal: io/fs, filepath: add more efficient Walk alternative

So, perhaps:

// Walk begins walking the subtree of fsys rooted at path root.
//
// The returned Walker initially contains only the root.
// If the root does not exist, Walk returns an empty, non-nil Walker
// and an error for which os.IsNotExist returns true.
func Walk(fsys FS, root string) (*Walker, error)

// Next advances the walker to the next entry within the current directory
// and returns that entry.
// If no entries remain, Next returns a nil *WalkEntry and ok=false.
//
// A new Walker includes only one entry, for the root of the walk itself.
// The first call to Next on a new Walker returns the root of the walk.
// If the root is not entered, the next call to Done will return true.
func (w *Walker) Next() (*WalkEntry, bool)

(with the remaining API per https://github.com/golang/go/issues/41974#issuecomment-709489088.)

I'm still not quite happy about EnterDir() returning only an error because it's too easy to miss (#20803), but that's also true of a great many established Go APIs (such as io.Closer).

rsc

comment created time in 13 days

issue commentgolang/go

proposal: io/fs, filepath: add more efficient Walk alternative

Actually, I think that reinforces my concern about error-handling with the Err method as originally proposed.

The current proposal says:

// Otherwise, Err can be non-nil when Exiting returns true,
// indicating a problem reading the directory being exited.

But that seems surprising to me: I would expect errors to be possible only when entering directories, not when exiting them.

rsc

comment created time in 13 days

issue commentgolang/go

proposal: io/fs, filepath: add more efficient Walk alternative

Thinking about the error-handling a bit more: probably Next doesn't need to return an error, because the only times it can fail are when entering a directory (covered by the error returned from EnterDir, although that one is unfortunately easy to accidentally drop) and when entering the root (which we could cover by returning an error from NewWalker).

Dropping the error from Next does mean that we can't read the directory entries lazily (because we have no way to report when reading fails), but perhaps that's fine because the ReadDir method returns a complete slice anyway.

rsc

comment created time in 13 days

issue commentgolang/go

proposal: io/fs, filepath: add more efficient Walk alternative

That's true, but experiences with iterators like sql.Rows and bufio.Scanner are exactly why I'm concerned about error-handling mistakes and aliasing bugs.

Also, sql.Rows and reflect.MapIter both iterate over flat data structures, not trees, so they don't really set much precedent one way or the other for SkipDir/Exiting vs. EnterDir/ExitDir.

rsc

comment created time in 13 days

more