[go] cmd/go: fix `-coverpkg` not ignoring special directories

25 views
Skip to first unread message

Gerrit Bot (Gerrit)

unread,
Mar 7, 2024, 3:16:39 PM3/7/24
to goph...@pubsubhelper.golang.org, Matthew Hughes, golang-co...@googlegroups.com

Gerrit Bot has uploaded the change for review

Commit message

cmd/go: fix `-coverpkg` not ignoring special directories

The pattern passed to `-coverpkg` when running `go test` would not
ignore directories usually ignored by the `go` command, i.e. those
beginning with "." or "_" are ignored by the go tool, as are directories
named "testdata".

Fix this by adding an explicit check for these (by following a similar
check in `src/cmd/doc/dirs.go`[1]) allowing us to ignore them.

Two tests are added for this change, one is a regression test attempting
to directly replicate the behaviour described in the issue, the other is
updating another test I saw fail when trialling other solutions to this
issue so I thought it worthwhile to be explicit about the change there.

See linked issue for a reproduction.

Fixes #66038

[1] https://go.googlesource.com/go/+/16e5d24480dca7ddcbdffb78a8ed5de3e5155dec/src/cmd/doc/dirs.go#136
Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
GitHub-Last-Rev: 63eb9f49f642e747d59a6a09e60de6dbdc011449
GitHub-Pull-Request: golang/go#66171

Change diff

diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go
index 3282295..01ee420 100644
--- a/src/cmd/go/go_test.go
+++ b/src/cmd/go/go_test.go
@@ -2778,6 +2778,47 @@
tg.grepStdout("coverage: 100", "no coverage")
}

+// regression test for github.com/golang/go/issues/66038
+func TestCoverpkgIngoresSpecialDirs(t *testing.T) {
+ skipIfGccgo(t, "gccgo has no cover tool")
+ tooSlow(t, "links and runs a test binary with coverage enabled")
+
+ tg := testgo(t)
+ defer tg.cleanup()
+
+ wd, err := os.Getwd()
+ tg.check(err)
+ tg.makeTempdir()
+ tg.check(os.Chdir(tg.path(".")))
+ defer func() { tg.check(os.Chdir(wd)) }()
+
+ tg.tempFile("a/a.go", `package a
+ import ( _ "b" )
+ func F(i int) int {
+ return i*i
+ }`)
+ tg.tempFile("a/a_test.go", `
+ package a
+ import ( "testing" )
+ func TestF(t *testing.T) { F(2) }
+ `)
+
+ for _, skipDir := range []string{".dir", "_dir", "testdata", "dir/testdata"} {
+ t.Run(skipDir, func(t *testing.T) {
+ tg.tempFile(fmt.Sprintf("%s/src/b/b.go", skipDir), `package b
+ func G(i int) int {
+ return i*i
+ }`)
+ tg.setenv("GOPATH", tg.path(skipDir))
+
+ tg.run("test", "-coverpkg=./...", "./...")
+
+ tg.grepStderrNot("no packages being tested depend on matches", "bad match message")
+ tg.grepStdout("coverage: 100", "no coverage")
+ })
+ }
+}
+
// Regression test for golang.org/issue/34499: version command should not crash
// when executed in a deleted directory on Linux.
func TestExecInDeletedDir(t *testing.T) {
diff --git a/src/cmd/go/internal/load/flag_test.go b/src/cmd/go/internal/load/flag_test.go
index d3223e1..f5b38f5 100644
--- a/src/cmd/go/internal/load/flag_test.go
+++ b/src/cmd/go/internal/load/flag_test.go
@@ -92,6 +92,7 @@
ppfDirTest("./...", 3, "/my/test/dir", "/my/test/dir/sub", "/my/test/dir/sub/sub", "/my/test/other", "/my/test/other/sub"),
ppfDirTest("../...", 4, "/my/test/dir", "/my/test/other", "/my/test/dir/sub", "/my/test/other/sub", "/my/other/test"),
ppfDirTest("../...sub...", 3, "/my/test/dir/sub", "/my/test/othersub", "/my/test/yellowsubmarine", "/my/other/test"),
+ ppfDirTest("./...", 1, "/my/test/dir", "/my/test/dir/.sub", "/test/dir/_sub", "/test/dir/testdata/sub"),
}

func ppfDirTest(pattern string, nmatch int, dirs ...string) ppfTest {
diff --git a/src/cmd/go/internal/load/search.go b/src/cmd/go/internal/load/search.go
index 565996a..83f469c 100644
--- a/src/cmd/go/internal/load/search.go
+++ b/src/cmd/go/internal/load/search.go
@@ -42,6 +42,19 @@
if rel == ".." || strings.HasPrefix(rel, "../") {
return false
}
+
+ cwdRel, err := filepath.Rel(cwd, p.Dir)
+ if err == nil {
+ if cwdRel != "." && !strings.HasPrefix(cwdRel, "../") {
+ for _, elem := range strings.Split(cwdRel, string(filepath.Separator)) {
+ // Avoid .foo, _foo, and testdata subdirectory trees.
+ if strings.HasPrefix(elem, ".") || strings.HasPrefix(elem, "_") || elem == "testdata" {
+ return false
+ }
+ }
+ }
+ }
+
return matchPath(rel)
}
case pattern == "all":

Change information

Files:
  • M src/cmd/go/go_test.go
  • M src/cmd/go/internal/load/flag_test.go
  • M src/cmd/go/internal/load/search.go
Change size: M
Delta: 3 files changed, 55 insertions(+), 0 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
Gerrit-Change-Number: 569895
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Gopher Robot (Gerrit)

unread,
Mar 7, 2024, 3:16:41 PM3/7/24
to Gerrit Bot, Matthew Hughes, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gopher Robot added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Gopher Robot . unresolved

I spotted some possible problems.

These findings are based on simple heuristics. If a finding appears wrong, briefly reply here saying so. Otherwise, please address any problems and update the GitHub PR. When complete, mark this comment as 'Done' and click the [blue 'Reply' button](https://go.dev/wiki/GerritBot#i-left-a-reply-to-a-comment-in-gerrit-but-no-one-but-me-can-see-it) above.

Possible problems detected:
1. Are you using markdown? Markdown should not be used to augment text in the commit message.
2. It looks like you have a properly formated bug reference, but the convention is to put bug references at the bottom of the commit message, even if a bug is also mentioned in the body of the message.

The commit title and commit message body come from the GitHub PR title and description, and must be edited in the GitHub web interface (not via git). For instructions, see [here](https://go.dev/wiki/GerritBot/#how-does-gerritbot-determine-the-final-commit-message). For guidelines on commit messages for the Go project, see [here](https://go.dev/doc/contribute#commit_messages).


(In general for Gerrit code reviews, the change author is expected to [log in to Gerrit](https://go-review.googlesource.com/login/) with a Gmail or other Google account and then close out each piece of feedback by marking it as 'Done' if implemented as suggested or otherwise reply to each review comment. See the [Review](https://go.dev/doc/contribute#review) section of the Contributing Guide for details.)

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
    Gerrit-Change-Number: 569895
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
    Gerrit-Comment-Date: Thu, 07 Mar 2024 20:16:35 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Gopher Robot (Gerrit)

    unread,
    Mar 7, 2024, 3:18:13 PM3/7/24
    to Gerrit Bot, Matthew Hughes, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Message from Gopher Robot

    Congratulations on opening your first change. Thank you for your contribution!

    Next steps:
    A maintainer will review your change and provide feedback. See
    https://go.dev/doc/contribute#review for more info and tips to get your
    patch through code review.

    Most changes in the Go project go through a few rounds of revision. This can be
    surprising to people new to the project. The careful, iterative review process
    is our way of helping mentor contributors and ensuring that their contributions
    have a lasting impact.

    During May-July and Nov-Jan the Go project is in a code freeze, during which
    little code gets reviewed or merged. If a reviewer responds with a comment like
    R=go1.11 or adds a tag like "wait-release", it means that this CL will be
    reviewed as part of the next development cycle. See https://go.dev/s/release
    for more details.

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
    Gerrit-Change-Number: 569895
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
    Gerrit-Comment-Date: Thu, 07 Mar 2024 20:18:07 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Than McIntosh (Gerrit)

    unread,
    Mar 7, 2024, 3:25:45 PM3/7/24
    to Gerrit Bot, Matthew Hughes, goph...@pubsubhelper.golang.org, Than McIntosh, Gopher Robot, golang-co...@googlegroups.com

    Than McIntosh added 4 comments

    Patchset-level comments
    Than McIntosh . resolved

    Looks good overall, see comments inline.

    Commit Message
    Line 22, Patchset 1 (Latest):See linked issue for a reproduction.
    Than McIntosh . unresolved

    you can probably leave this out, folks will know to go read the issue for more info.

    File src/cmd/go/go_test.go
    Line 2782, Patchset 1 (Latest):func TestCoverpkgIngoresSpecialDirs(t *testing.T) {
    Than McIntosh . unresolved

    Is there a chance you can write this as a script test instead of a hand-coded test? For this sort of scenario (where you have to build a program and do testing) the script test would probably be a lot more readable. If using the script engine doesn't work for some reason we can fall back to this.

    File src/cmd/go/internal/load/search.go
    Line 49, Patchset 1 (Latest): for _, elem := range strings.Split(cwdRel, string(filepath.Separator)) {
    Than McIntosh . unresolved

    maybe use filepath.Split here?

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
    Gerrit-Change-Number: 569895
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
    Gerrit-CC: Than McIntosh <th...@google.com>
    Gerrit-Comment-Date: Thu, 07 Mar 2024 20:25:41 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Than McIntosh (Gerrit)

    unread,
    Mar 7, 2024, 3:26:13 PM3/7/24
    to Gerrit Bot, Matthew Hughes, goph...@pubsubhelper.golang.org, Sam Thanawalla, Michael Matloob, Than McIntosh, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Michael Matloob and Sam Thanawalla

    Than McIntosh voted Commit-Queue+1

    Commit-Queue+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Michael Matloob
    • Sam Thanawalla
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
    Gerrit-Change-Number: 569895
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
    Gerrit-Reviewer: Than McIntosh <th...@google.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
    Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Thu, 07 Mar 2024 20:26:10 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    open
    diffy

    Matthew Hughes (Gerrit)

    unread,
    Mar 7, 2024, 3:46:46 PM3/7/24
    to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Sam Thanawalla, Michael Matloob, Than McIntosh, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Michael Matloob, Sam Thanawalla and Than McIntosh

    Matthew Hughes added 4 comments

    Patchset-level comments
    Matthew Hughes . unresolved

    Thanks for the review, I had some follow-up questions from it

    Commit Message
    Line 22, Patchset 1 (Latest):See linked issue for a reproduction.
    Than McIntosh . resolved

    you can probably leave this out, folks will know to go read the issue for more info.

    Matthew Hughes

    Good call, I've updated the PR description (from what I understand that will propagate the change here, rather than updating the commit itself)

    File src/cmd/go/go_test.go
    Line 2782, Patchset 1 (Latest):func TestCoverpkgIngoresSpecialDirs(t *testing.T) {
    Than McIntosh . unresolved

    Is there a chance you can write this as a script test instead of a hand-coded test? For this sort of scenario (where you have to build a program and do testing) the script test would probably be a lot more readable. If using the script engine doesn't work for some reason we can fall back to this.

    Matthew Hughes

    Ah, I didn't know script tests were a thing. From a glance these look to be under src/cmd/go/testdata/script, is that correct? If so I'll have a look over there and try and build something

    File src/cmd/go/internal/load/search.go
    Line 49, Patchset 1 (Latest): for _, elem := range strings.Split(cwdRel, string(filepath.Separator)) {
    Than McIntosh . unresolved

    maybe use filepath.Split here?

    Matthew Hughes

    Just as I was preparing this commit I was wondering if it's sufficient to compare just on the directory name: e.g. should `./some/dir/testdata/file.go` be ignored as well as `./testdata/file.go` (or also something like `./some/dir/.dir/file.go`) I think for these nested cases comparing just on the directory is not enough, and each component of the path needs to be checked. Though I've been undecided on this since submitting the change, what are your thoughts?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Michael Matloob
    • Sam Thanawalla
    • Than McIntosh
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
    Gerrit-Change-Number: 569895
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
    Gerrit-Reviewer: Than McIntosh <th...@google.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
    Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
    Gerrit-Attention: Than McIntosh <th...@google.com>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Thu, 07 Mar 2024 20:46:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Than McIntosh <th...@google.com>
    unsatisfied_requirement
    open
    diffy

    Gerrit Bot (Gerrit)

    unread,
    Mar 7, 2024, 3:49:37 PM3/7/24
    to Matthew Hughes, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
    Attention needed from Michael Matloob, Sam Thanawalla and Than McIntosh

    Gerrit Bot uploaded new patchset

    Gerrit Bot uploaded patch set #2 to this change.
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Michael Matloob
    • Sam Thanawalla
    • Than McIntosh
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: newpatchset
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
    Gerrit-Change-Number: 569895
    Gerrit-PatchSet: 2
    unsatisfied_requirement
    open
    diffy

    Matthew Hughes (Gerrit)

    unread,
    Mar 7, 2024, 3:53:35 PM3/7/24
    to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Sam Thanawalla, Michael Matloob, Than McIntosh, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Michael Matloob, Sam Thanawalla and Than McIntosh

    Matthew Hughes added 1 comment

    Patchset-level comments
    File-level comment, Patchset 2 (Latest):
    Matthew Hughes . resolved

    At a glance the TryBot failures didn't appear directly related to my changes. I've just rebased on master (I was a couple of hundred commits behind) to see if if that fixes it

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Michael Matloob
    • Sam Thanawalla
    • Than McIntosh
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
    Gerrit-Change-Number: 569895
    Gerrit-PatchSet: 2
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
    Gerrit-Reviewer: Than McIntosh <th...@google.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
    Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
    Gerrit-Attention: Than McIntosh <th...@google.com>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Thu, 07 Mar 2024 20:53:29 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Than McIntosh (Gerrit)

    unread,
    Mar 7, 2024, 3:57:18 PM3/7/24
    to Gerrit Bot, Matthew Hughes, goph...@pubsubhelper.golang.org, Than McIntosh, Go LUCI, Sam Thanawalla, Michael Matloob, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Michael Matloob and Sam Thanawalla

    Than McIntosh voted Commit-Queue+1

    Commit-Queue+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Michael Matloob
    • Sam Thanawalla
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
    Gerrit-Change-Number: 569895
    Gerrit-PatchSet: 2
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
    Gerrit-Reviewer: Than McIntosh <th...@google.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
    Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Thu, 07 Mar 2024 20:57:14 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    open
    diffy

    Gerrit Bot (Gerrit)

    unread,
    Mar 7, 2024, 4:03:29 PM3/7/24
    to Matthew Hughes, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
    Attention needed from Michael Matloob, Sam Thanawalla and Than McIntosh

    Gerrit Bot uploaded new patchset

    Gerrit Bot uploaded patch set #3 to this change.
    Following approvals got outdated and were removed:
    • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Michael Matloob
    • Sam Thanawalla
    • Than McIntosh
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: newpatchset
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
    Gerrit-Change-Number: 569895
    Gerrit-PatchSet: 3
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
    Gerrit-Reviewer: Than McIntosh <th...@google.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
    Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
    unsatisfied_requirement
    open
    diffy

    Than McIntosh (Gerrit)

    unread,
    Mar 8, 2024, 9:27:29 AM3/8/24
    to Gerrit Bot, Matthew Hughes, goph...@pubsubhelper.golang.org, Than McIntosh, Go LUCI, Sam Thanawalla, Michael Matloob, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Matthew Hughes, Michael Matloob and Sam Thanawalla

    Than McIntosh added 2 comments

    File src/cmd/go/go_test.go
    Line 2782, Patchset 1:func TestCoverpkgIngoresSpecialDirs(t *testing.T) {
    Than McIntosh . unresolved

    Is there a chance you can write this as a script test instead of a hand-coded test? For this sort of scenario (where you have to build a program and do testing) the script test would probably be a lot more readable. If using the script engine doesn't work for some reason we can fall back to this.

    Matthew Hughes

    Ah, I didn't know script tests were a thing. From a glance these look to be under src/cmd/go/testdata/script, is that correct? If so I'll have a look over there and try and build something

    Than McIntosh

    Yes, testdata/script/<testcase>.txt.

    You could use testdata/script/cover_swig.txt or testdata/script/cover_coverpkg_with_init.txt as examples.

    File src/cmd/go/internal/load/search.go
    Line 49, Patchset 1: for _, elem := range strings.Split(cwdRel, string(filepath.Separator)) {
    Than McIntosh . resolved

    maybe use filepath.Split here?

    Matthew Hughes

    Just as I was preparing this commit I was wondering if it's sufficient to compare just on the directory name: e.g. should `./some/dir/testdata/file.go` be ignored as well as `./testdata/file.go` (or also something like `./some/dir/.dir/file.go`) I think for these nested cases comparing just on the directory is not enough, and each component of the path needs to be checked. Though I've been undecided on this since submitting the change, what are your thoughts?

    Than McIntosh

    On second thought I think you are right, it does make sense to look at all the path elements.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Matthew Hughes
    • Michael Matloob
    • Sam Thanawalla
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
    Gerrit-Change-Number: 569895
    Gerrit-PatchSet: 3
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
    Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
    Gerrit-Reviewer: Than McIntosh <th...@google.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
    Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
    Gerrit-Attention: Matthew Hughes <matthewh...@gmail.com>
    Gerrit-Attention: Michael Matloob <mat...@golang.org>
    Gerrit-Comment-Date: Fri, 08 Mar 2024 14:27:22 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Matthew Hughes <matthewh...@gmail.com>
    Comment-In-Reply-To: Than McIntosh <th...@google.com>
    unsatisfied_requirement
    open
    diffy

    Emmanuel Odeke (Gerrit)

    unread,
    Mar 8, 2024, 9:56:06 AM3/8/24
    to Gerrit Bot, Matthew Hughes, goph...@pubsubhelper.golang.org, Than McIntosh, Go LUCI, Sam Thanawalla, Michael Matloob, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Matthew Hughes, Michael Matloob and Sam Thanawalla

    Emmanuel Odeke voted and added 4 comments

    Votes added by Emmanuel Odeke

    Hold+1

    4 comments

    Patchset-level comments
    File-level comment, Patchset 3 (Latest):
    Emmanuel Odeke . resolved

    Thank you for this change Matthew! I have added some suggestions to improve the change, please take a look.

    Commit Message
    Line 7, Patchset 3 (Latest):cmd/go: fix `-coverpkg` not ignoring special directories
    Emmanuel Odeke . unresolved

    We avoid markdown in what gets into the Go tree, so please do this:

    cmd/go: make -coverpkg properly ignore special directories

    Line 9, Patchset 3 (Latest):The pattern passed to `-coverpkg` when running `go test` would not

    ignore directories usually ignored by the `go` command, i.e. those
    beginning with "." or "_" are ignored by the go tool, as are directories
    named "testdata".

    Fix this by adding an explicit check for these (by following a similar
    check in `src/cmd/doc/dirs.go`[1]) allowing us to ignore them.

    Two tests are added for this change, one is a regression test attempting
    to directly replicate the behaviour described in the issue, the other is
    updating another test I saw fail when trialling other solutions to this
    issue so I thought it worthwhile to be explicit about the change there.

    Emmanuel Odeke . unresolved

    We can make the commit message much more concise and precise by:

    This change fixes "go test -coverpkg" to properly ignore
    special directories that are typically ignored by the "go" command
    for example directories beginnning with "." or "_" or "testdata"

    Fixes #66038

    File src/cmd/go/internal/load/search.go
    Line 46, Patchset 3 (Latest): cwdRel, err := filepath.Rel(cwd, p.Dir)
    if err == nil {

    if cwdRel != "." && !strings.HasPrefix(cwdRel, "../") {
    for _, elem := range strings.Split(cwdRel, string(filepath.Separator)) {
    // Avoid .foo, _foo, and testdata subdirectory trees.
    if strings.HasPrefix(elem, ".") || strings.HasPrefix(elem, "_") || elem == "testdata" {
    return false
    }
    }
    }
    }
    Emmanuel Odeke . unresolved

    We can refactor by inversion to make this code more legible

    ```
    relToWorkingDir, err := filepath.Rel(cwd, p.Dir)
    if err != nil {
    return matchPath(rel)
    }
    hasAnyPrefix := func(dir, prefixes ...string) bool {
    for _, prefix := range prefixes {
    if strings.HasPrefix(dir, prefix) {
    return true
    }
    }
    return false
    }
    if relToWorkingDir == "." || hasAnyPrefix(relToWorkingDir, ".." + string(filepath.Separator)) {
    // Not a special directory so can return immediately
    return matchPath(rel)
    }
    // Otherwise avoid special directories "testdata" or beginning with ".", "_".
    pathComponents := strings.Split(relToWorkingDir, string(filepath.Separator))
    for _, elem := range pathComponents {
    if hasAnyPrefix(elem, ".", "_") || elem == "testdata" {
    return false
    }
    }

    return matchPath(rel)
    ```

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Matthew Hughes
    • Michael Matloob
    • Sam Thanawalla
    Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Holds
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
      Gerrit-Change-Number: 569895
      Gerrit-PatchSet: 3
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
      Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
      Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
      Gerrit-Reviewer: Than McIntosh <th...@google.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
      Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
      Gerrit-Attention: Matthew Hughes <matthewh...@gmail.com>
      Gerrit-Attention: Michael Matloob <mat...@golang.org>
      Gerrit-Comment-Date: Fri, 08 Mar 2024 14:55:59 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      unsatisfied_requirement
      open
      diffy

      Gerrit Bot (Gerrit)

      unread,
      Mar 8, 2024, 4:27:57 PM3/8/24
      to Matthew Hughes, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
      Attention needed from Emmanuel Odeke, Matthew Hughes, Michael Matloob, Sam Thanawalla and Than McIntosh

      Gerrit Bot uploaded new patchset

      Gerrit Bot uploaded patch set #4 to this change.
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Emmanuel Odeke
      • Matthew Hughes
      • Michael Matloob
      • Sam Thanawalla
      • Than McIntosh
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Holds
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
      Gerrit-Change-Number: 569895
      Gerrit-PatchSet: 4
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
      Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
      Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
      Gerrit-Reviewer: Than McIntosh <th...@google.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
      Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
      Gerrit-Attention: Matthew Hughes <matthewh...@gmail.com>
      Gerrit-Attention: Than McIntosh <th...@google.com>
      Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
      Gerrit-Attention: Michael Matloob <mat...@golang.org>
      unsatisfied_requirement
      open
      diffy

      Matthew Hughes (Gerrit)

      unread,
      Mar 19, 2024, 2:43:11 PM3/19/24
      to Gerrit Bot, goph...@pubsubhelper.golang.org, Emmanuel Odeke, Than McIntosh, Go LUCI, Sam Thanawalla, Michael Matloob, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Emmanuel Odeke, Michael Matloob, Sam Thanawalla and Than McIntosh

      Matthew Hughes added 5 comments

      Patchset-level comments
      File-level comment, Patchset 4 (Latest):
      Matthew Hughes . resolved

      Thanks for the reviews!

      Apologies for the slowed response, I hadn't realised I never clicked the 'reply' button 😐

      Commit Message
      Line 7, Patchset 3:cmd/go: fix `-coverpkg` not ignoring special directories
      Emmanuel Odeke . resolved

      We avoid markdown in what gets into the Go tree, so please do this:

      cmd/go: make -coverpkg properly ignore special directories

      Matthew Hughes

      Thanks, updated the PR title

      Line 9, Patchset 3:The pattern passed to `-coverpkg` when running `go test` would not

      ignore directories usually ignored by the `go` command, i.e. those
      beginning with "." or "_" are ignored by the go tool, as are directories
      named "testdata".

      Fix this by adding an explicit check for these (by following a similar
      check in `src/cmd/doc/dirs.go`[1]) allowing us to ignore them.

      Two tests are added for this change, one is a regression test attempting
      to directly replicate the behaviour described in the issue, the other is
      updating another test I saw fail when trialling other solutions to this
      issue so I thought it worthwhile to be explicit about the change there.

      Fixes #66038

      [1] https://go.googlesource.com/go/+/16e5d24480dca7ddcbdffb78a8ed5de3e5155dec/src/cmd/doc/dirs.go#136
      Emmanuel Odeke . unresolved

      We can make the commit message much more concise and precise by:

      This change fixes "go test -coverpkg" to properly ignore
      special directories that are typically ignored by the "go" command
      for example directories beginnning with "." or "_" or "testdata"

      Fixes #66038

      Matthew Hughes

      Thanks, I've updated the PR description in GitHub. I left the paragraph in describing the reasoning behind the tests added, do you think there's value in this or should I remove it too?

      File src/cmd/go/go_test.go
      Line 2782, Patchset 1:func TestCoverpkgIngoresSpecialDirs(t *testing.T) {
      Than McIntosh . unresolved

      Is there a chance you can write this as a script test instead of a hand-coded test? For this sort of scenario (where you have to build a program and do testing) the script test would probably be a lot more readable. If using the script engine doesn't work for some reason we can fall back to this.

      Matthew Hughes

      Ah, I didn't know script tests were a thing. From a glance these look to be under src/cmd/go/testdata/script, is that correct? If so I'll have a look over there and try and build something

      Than McIntosh

      Yes, testdata/script/<testcase>.txt.

      You could use testdata/script/cover_swig.txt or testdata/script/cover_coverpkg_with_init.txt as examples.

      Matthew Hughes

      Yes, testdata/script/<testcase>.txt.

      You could use testdata/script/cover_swig.txt or testdata/script/cover_coverpkg_with_init.txt as examples.

      Thanks I gave this a shot with the latest patchset

      File src/cmd/go/internal/load/search.go
      Line 46, Patchset 3: cwdRel, err := filepath.Rel(cwd, p.Dir)

      if err == nil {
      if cwdRel != "." && !strings.HasPrefix(cwdRel, "../") {
      for _, elem := range strings.Split(cwdRel, string(filepath.Separator)) {
      // Avoid .foo, _foo, and testdata subdirectory trees.
      if strings.HasPrefix(elem, ".") || strings.HasPrefix(elem, "_") || elem == "testdata" {
      return false
      }
      }
      }
      }
      Emmanuel Odeke . resolved

      We can refactor by inversion to make this code more legible

      ```
      relToWorkingDir, err := filepath.Rel(cwd, p.Dir)
      if err != nil {
      return matchPath(rel)
      }
      hasAnyPrefix := func(dir, prefixes ...string) bool {
      for _, prefix := range prefixes {
      if strings.HasPrefix(dir, prefix) {
      return true
      }
      }
      return false
      }
      if relToWorkingDir == "." || hasAnyPrefix(relToWorkingDir, ".." + string(filepath.Separator)) {
      // Not a special directory so can return immediately
      return matchPath(rel)
      }
      // Otherwise avoid special directories "testdata" or beginning with ".", "_".
      pathComponents := strings.Split(relToWorkingDir, string(filepath.Separator))
      for _, elem := range pathComponents {
      if hasAnyPrefix(elem, ".", "_") || elem == "testdata" {
      return false
      }
      }

      return matchPath(rel)
      ```

      Matthew Hughes

      Thanks for the suggestion, I've added it with the latest changeset

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Emmanuel Odeke
      • Michael Matloob
      • Sam Thanawalla
      • Than McIntosh
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Holds
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
      Gerrit-Change-Number: 569895
      Gerrit-PatchSet: 4
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
      Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
      Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
      Gerrit-Reviewer: Than McIntosh <th...@google.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
      Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
      Gerrit-Attention: Than McIntosh <th...@google.com>
      Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
      Gerrit-Attention: Michael Matloob <mat...@golang.org>
      Gerrit-Comment-Date: Tue, 19 Mar 2024 18:43:04 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Matthew Hughes <matthewh...@gmail.com>
      Comment-In-Reply-To: Than McIntosh <th...@google.com>
      Comment-In-Reply-To: Emmanuel Odeke <emma...@orijtech.com>
      unsatisfied_requirement
      open
      diffy

      Emmanuel Odeke (Gerrit)

      unread,
      Mar 19, 2024, 2:58:19 PM3/19/24
      to Gerrit Bot, Matthew Hughes, goph...@pubsubhelper.golang.org, Ian Lance Taylor, Than McIntosh, Go LUCI, Sam Thanawalla, Michael Matloob, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Ian Lance Taylor, Matthew Hughes, Michael Matloob, Sam Thanawalla and Than McIntosh

      Emmanuel Odeke voted and added 3 comments

      Votes added by Emmanuel Odeke

      Code-Review+1
      Commit-Queue+1
      Hold+0
      Run-TryBot+1

      3 comments

      Patchset-level comments
      Emmanuel Odeke . resolved

      Thank you Matthew! Just one more change then good to go in my eyes!

      Commit Message
      Line 9, Patchset 3:The pattern passed to `-coverpkg` when running `go test` would not
      ignore directories usually ignored by the `go` command, i.e. those
      beginning with "." or "_" are ignored by the go tool, as are directories
      named "testdata".

      Fix this by adding an explicit check for these (by following a similar
      check in `src/cmd/doc/dirs.go`[1]) allowing us to ignore them.

      Two tests are added for this change, one is a regression test attempting
      to directly replicate the behaviour described in the issue, the other is
      updating another test I saw fail when trialling other solutions to this
      issue so I thought it worthwhile to be explicit about the change there.

      Fixes #66038

      [1] https://go.googlesource.com/go/+/16e5d24480dca7ddcbdffb78a8ed5de3e5155dec/src/cmd/doc/dirs.go#136
      Emmanuel Odeke . resolved

      We can make the commit message much more concise and precise by:

      This change fixes "go test -coverpkg" to properly ignore
      special directories that are typically ignored by the "go" command
      for example directories beginnning with "." or "_" or "testdata"

      Fixes #66038

      Matthew Hughes

      Thanks, I've updated the PR description in GitHub. I left the paragraph in describing the reasoning behind the tests added, do you think there's value in this or should I remove it too?

      Emmanuel Odeke

      Not a problem; I think the paragraph below explaining your rationale is useful, please keep it. Thank you

      File src/cmd/go/internal/load/search.go
      Line 60, Patchset 4 (Latest): if relToWorkingDir == "." || hasAnyPrefix(relToWorkingDir, ".."+string(filepath.Separator)) {

      // Not a special directory so can return immediately
      return matchPath(rel)
      }

      // Otherwise avoid special directories "testdata" or beginning with ".", "_".
      pathComponents := strings.Split(relToWorkingDir, string(filepath.Separator))
      Emmanuel Odeke . unresolved

      One more nit that I overlooked: could we please extract string(filepath.Separator) to a variable like this:

      ```go
      sep := string(filepath.Separator)
      if relToWorkingDir == "." || hasAnyPrefix(relToWorkingDir, ".."+sep) {

      // Not a special directory so can return immediately
      return matchPath(rel)
      }
      			// Otherwise avoid special directories "testdata" or beginning with ".", "_".
      			pathComponents := strings.Split(relToWorkingDir, sep)
      ```
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Ian Lance Taylor
      • Matthew Hughes
      • Michael Matloob
      • Sam Thanawalla
      • Than McIntosh
        Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedLegacy-TryBots-Pass
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement is not satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
          Gerrit-Change-Number: 569895
          Gerrit-PatchSet: 4
          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
          Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
          Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
          Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
          Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
          Gerrit-Reviewer: Than McIntosh <th...@google.com>
          Gerrit-CC: Gopher Robot <go...@golang.org>
          Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
          Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
          Gerrit-Attention: Matthew Hughes <matthewh...@gmail.com>
          Gerrit-Attention: Than McIntosh <th...@google.com>
          Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
          Gerrit-Attention: Michael Matloob <mat...@golang.org>
          Gerrit-Comment-Date: Tue, 19 Mar 2024 18:58:12 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Matthew Hughes <matthewh...@gmail.com>
          Comment-In-Reply-To: Emmanuel Odeke <emma...@orijtech.com>
          unsatisfied_requirement
          open
          diffy

          Matthew Hughes (Gerrit)

          unread,
          Mar 19, 2024, 3:09:10 PM3/19/24
          to Gerrit Bot, goph...@pubsubhelper.golang.org, Ian Lance Taylor, Emmanuel Odeke, Than McIntosh, Go LUCI, Sam Thanawalla, Michael Matloob, Gopher Robot, golang-co...@googlegroups.com
          Attention needed from Ian Lance Taylor, Michael Matloob, Sam Thanawalla and Than McIntosh

          Matthew Hughes added 2 comments

          Patchset-level comments
          File-level comment, Patchset 1:
          Matthew Hughes . resolved

          Thanks for the review, I had some follow-up questions from it

          Matthew Hughes

          whoops, made this comment in the wrong place...was meant to be on the reply to the view

          File-level comment, Patchset 1:
          Gopher Robot . resolved

          I spotted some possible problems.

          These findings are based on simple heuristics. If a finding appears wrong, briefly reply here saying so. Otherwise, please address any problems and update the GitHub PR. When complete, mark this comment as 'Done' and click the [blue 'Reply' button](https://go.dev/wiki/GerritBot#i-left-a-reply-to-a-comment-in-gerrit-but-no-one-but-me-can-see-it) above.

          Possible problems detected:
          1. Are you using markdown? Markdown should not be used to augment text in the commit message.
          2. It looks like you have a properly formated bug reference, but the convention is to put bug references at the bottom of the commit message, even if a bug is also mentioned in the body of the message.

          The commit title and commit message body come from the GitHub PR title and description, and must be edited in the GitHub web interface (not via git). For instructions, see [here](https://go.dev/wiki/GerritBot/#how-does-gerritbot-determine-the-final-commit-message). For guidelines on commit messages for the Go project, see [here](https://go.dev/doc/contribute#commit_messages).


          (In general for Gerrit code reviews, the change author is expected to [log in to Gerrit](https://go-review.googlesource.com/login/) with a Gmail or other Google account and then close out each piece of feedback by marking it as 'Done' if implemented as suggested or otherwise reply to each review comment. See the [Review](https://go.dev/doc/contribute#review) section of the Contributing Guide for details.)

          Matthew Hughes

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ian Lance Taylor
          Gerrit-Attention: Than McIntosh <th...@google.com>
          Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
          Gerrit-Attention: Michael Matloob <mat...@golang.org>
          Gerrit-Comment-Date: Tue, 19 Mar 2024 19:09:02 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Gopher Robot <go...@golang.org>
          Comment-In-Reply-To: Matthew Hughes <matthewh...@gmail.com>
          unsatisfied_requirement
          open
          diffy

          Gerrit Bot (Gerrit)

          unread,
          Mar 19, 2024, 3:17:48 PM3/19/24
          to Matthew Hughes, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
          Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Matloob, Sam Thanawalla and Than McIntosh

          Gerrit Bot uploaded new patchset

          Gerrit Bot uploaded patch set #5 to this change.
          Following approvals got outdated and were removed:
          • Legacy-TryBots-Pass: TryBot-Result-1 by Gopher Robot, Run-TryBot+1 by Emmanuel Odeke
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Emmanuel Odeke
          • Ian Lance Taylor
          • Michael Matloob
          • Sam Thanawalla
          • Than McIntosh
            Submit Requirements:
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              • requirement is not satisfiedReview-Enforcement
              • requirement is not satisfiedTryBots-Pass
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: newpatchset
              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
              Gerrit-Change-Number: 569895
              Gerrit-PatchSet: 5
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
              Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
              Gerrit-Reviewer: Gopher Robot <go...@golang.org>
              Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
              Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
              Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
              Gerrit-Reviewer: Than McIntosh <th...@google.com>
              Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
              Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
              Gerrit-Attention: Than McIntosh <th...@google.com>
              Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
              unsatisfied_requirement
              open
              diffy

              Matthew Hughes (Gerrit)

              unread,
              Mar 19, 2024, 3:18:29 PM3/19/24
              to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Gopher Robot, Ian Lance Taylor, Emmanuel Odeke, Than McIntosh, Sam Thanawalla, Michael Matloob, golang-co...@googlegroups.com
              Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Matloob, Sam Thanawalla and Than McIntosh

              Matthew Hughes added 1 comment

              Patchset-level comments
              File-level comment, Patchset 4:
              Gopher Robot . unresolved

              TryBots beginning. Status page: https://farmer.golang.org/try?commit=4f35b335

              Gopher Robot

              1 of 48 TryBots failed.
              Failed on openbsd-amd64-72: https://storage.googleapis.com/go-build-log/4f35b335/openbsd-amd64-72_1c3aaacc.log

              Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test *exactly* your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.

              Matthew Hughes

              I see similar looking failures on older builds. I've rebased my changed on master (it looks like recent builds are running ok on this arch)

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Emmanuel Odeke
              • Ian Lance Taylor
              • Michael Matloob
              • Sam Thanawalla
              • Than McIntosh
              Submit Requirements:
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              • requirement is not satisfiedReview-Enforcement
              • requirement is not satisfiedTryBots-Pass
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
              Gerrit-Change-Number: 569895
              Gerrit-PatchSet: 5
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
              Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
              Gerrit-Reviewer: Gopher Robot <go...@golang.org>
              Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
              Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
              Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
              Gerrit-Reviewer: Than McIntosh <th...@google.com>
              Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
              Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
              Gerrit-Attention: Than McIntosh <th...@google.com>
              Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
              Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
              Gerrit-Attention: Michael Matloob <mat...@golang.org>
              Gerrit-Comment-Date: Tue, 19 Mar 2024 19:18:22 +0000
              unsatisfied_requirement
              open
              diffy

              Than McIntosh (Gerrit)

              unread,
              Mar 19, 2024, 4:12:57 PM3/19/24
              to Gerrit Bot, Matthew Hughes, goph...@pubsubhelper.golang.org, Than McIntosh, Go LUCI, Gopher Robot, Ian Lance Taylor, Emmanuel Odeke, Sam Thanawalla, Michael Matloob, golang-co...@googlegroups.com
              Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Matloob and Sam Thanawalla

              Than McIntosh voted Commit-Queue+1

              Commit-Queue+1
              Open in Gerrit

              Related details

              Attention is currently required from:
              • Emmanuel Odeke
              • Ian Lance Taylor
              • Michael Matloob
              • Sam Thanawalla
              Submit Requirements:
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              • requirement is not satisfiedReview-Enforcement
              • requirement is not satisfiedTryBots-Pass
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
              Gerrit-Change-Number: 569895
              Gerrit-PatchSet: 5
              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
              Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
              Gerrit-Reviewer: Gopher Robot <go...@golang.org>
              Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
              Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
              Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
              Gerrit-Reviewer: Than McIntosh <th...@google.com>
              Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
              Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
              Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
              Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
              Gerrit-Attention: Michael Matloob <mat...@golang.org>
              Gerrit-Comment-Date: Tue, 19 Mar 2024 20:12:53 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes
              unsatisfied_requirement
              open
              diffy

              Matthew Hughes (Gerrit)

              unread,
              Mar 24, 2024, 5:22:03 PM3/24/24
              to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Than McIntosh, Gopher Robot, Ian Lance Taylor, Emmanuel Odeke, Sam Thanawalla, Michael Matloob, golang-co...@googlegroups.com
              Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Matloob and Sam Thanawalla

              Matthew Hughes added 1 comment

              File src/cmd/go/internal/load/search.go
              Line 60, Patchset 4: if relToWorkingDir == "." || hasAnyPrefix(relToWorkingDir, ".."+string(filepath.Separator)) {

              // Not a special directory so can return immediately
              return matchPath(rel)
              }

              // Otherwise avoid special directories "testdata" or beginning with ".", "_".
              pathComponents := strings.Split(relToWorkingDir, string(filepath.Separator))
              Emmanuel Odeke . unresolved

              One more nit that I overlooked: could we please extract string(filepath.Separator) to a variable like this:

              ```go
              sep := string(filepath.Separator)
              if relToWorkingDir == "." || hasAnyPrefix(relToWorkingDir, ".."+sep) {
              // Not a special directory so can return immediately
              return matchPath(rel)
              }
              			// Otherwise avoid special directories "testdata" or beginning with ".", "_".
              pathComponents := strings.Split(relToWorkingDir, sep)
              ```
              Matthew Hughes

              sorry! I managed to miss the comment when looking over your review. Addressed this with the latest change

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Emmanuel Odeke
              • Ian Lance Taylor
              • Michael Matloob
              • Sam Thanawalla
              Submit Requirements:
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                • requirement is not satisfiedReview-Enforcement
                • requirement satisfiedTryBots-Pass
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: go
                Gerrit-Branch: master
                Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                Gerrit-Change-Number: 569895
                Gerrit-PatchSet: 5
                Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
                Gerrit-Reviewer: Gopher Robot <go...@golang.org>
                Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
                Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
                Gerrit-Reviewer: Than McIntosh <th...@google.com>
                Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
                Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
                Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                Gerrit-Attention: Michael Matloob <mat...@golang.org>
                Gerrit-Comment-Date: Sun, 24 Mar 2024 21:21:57 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: Emmanuel Odeke <emma...@orijtech.com>
                unsatisfied_requirement
                satisfied_requirement
                open
                diffy

                Gerrit Bot (Gerrit)

                unread,
                Mar 24, 2024, 5:24:31 PM3/24/24
                to Matthew Hughes, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Matloob, Sam Thanawalla and Than McIntosh

                Gerrit Bot uploaded new patchset

                Gerrit Bot uploaded patch set #6 to this change.
                Following approvals got outdated and were removed:
                • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
                Open in Gerrit

                Related details

                Attention is currently required from:
                • Emmanuel Odeke
                • Ian Lance Taylor
                • Michael Matloob
                • Sam Thanawalla
                • Than McIntosh
                Submit Requirements:
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  • requirement is not satisfiedReview-Enforcement
                  • requirement is not satisfiedTryBots-Pass
                  Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                  Gerrit-MessageType: newpatchset
                  Gerrit-Project: go
                  Gerrit-Branch: master
                  Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                  Gerrit-Change-Number: 569895
                  Gerrit-PatchSet: 6
                  Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                  Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
                  Gerrit-Reviewer: Gopher Robot <go...@golang.org>
                  Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                  Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
                  Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
                  Gerrit-Reviewer: Than McIntosh <th...@google.com>
                  Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
                  Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
                  Gerrit-Attention: Than McIntosh <th...@google.com>
                  unsatisfied_requirement
                  open
                  diffy

                  Emmanuel Odeke (Gerrit)

                  unread,
                  Mar 24, 2024, 7:10:03 PM3/24/24
                  to Gerrit Bot, Matthew Hughes, goph...@pubsubhelper.golang.org, Go LUCI, Than McIntosh, Gopher Robot, Ian Lance Taylor, Sam Thanawalla, Michael Matloob, golang-co...@googlegroups.com
                  Attention needed from Matthew Hughes

                  Emmanuel Odeke voted and added 1 comment

                  Votes added by Emmanuel Odeke

                  Code-Review+1

                  1 comment

                  File src/cmd/go/internal/load/search.go
                  Line 60, Patchset 4: if relToWorkingDir == "." || hasAnyPrefix(relToWorkingDir, ".."+string(filepath.Separator)) {
                  // Not a special directory so can return immediately
                  return matchPath(rel)
                  }

                  // Otherwise avoid special directories "testdata" or beginning with ".", "_".
                  pathComponents := strings.Split(relToWorkingDir, string(filepath.Separator))
                  Emmanuel Odeke . unresolved

                  One more nit that I overlooked: could we please extract string(filepath.Separator) to a variable like this:

                  ```go
                  sep := string(filepath.Separator)
                  if relToWorkingDir == "." || hasAnyPrefix(relToWorkingDir, ".."+sep) {
                  // Not a special directory so can return immediately
                  return matchPath(rel)
                  }
                  			// Otherwise avoid special directories "testdata" or beginning with ".", "_".
                  pathComponents := strings.Split(relToWorkingDir, sep)
                  ```
                  Matthew Hughes

                  sorry! I managed to miss the comment when looking over your review. Addressed this with the latest change

                  Emmanuel Odeke

                  Not quite addressed: sep := string(filepath.Separator) removes the need to always invoke string(sep) every time.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Matthew Hughes
                  Submit Requirements:
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  • requirement is not satisfiedReview-Enforcement
                  • requirement is not satisfiedTryBots-Pass
                  Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                  Gerrit-MessageType: comment
                  Gerrit-Project: go
                  Gerrit-Branch: master
                  Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                  Gerrit-Change-Number: 569895
                  Gerrit-PatchSet: 6
                  Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                  Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
                  Gerrit-Reviewer: Gopher Robot <go...@golang.org>
                  Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                  Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
                  Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
                  Gerrit-Reviewer: Than McIntosh <th...@google.com>
                  Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
                  Gerrit-Attention: Matthew Hughes <matthewh...@gmail.com>
                  Gerrit-Comment-Date: Sun, 24 Mar 2024 23:09:50 +0000
                  unsatisfied_requirement
                  open
                  diffy

                  Matthew Hughes (Gerrit)

                  unread,
                  Mar 24, 2024, 7:13:24 PM3/24/24
                  to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Than McIntosh, Gopher Robot, Ian Lance Taylor, Emmanuel Odeke, Sam Thanawalla, Michael Matloob, golang-co...@googlegroups.com
                  Attention needed from Emmanuel Odeke

                  Matthew Hughes added 1 comment

                  File src/cmd/go/internal/load/search.go
                  Line 60, Patchset 4: if relToWorkingDir == "." || hasAnyPrefix(relToWorkingDir, ".."+string(filepath.Separator)) {
                  // Not a special directory so can return immediately
                  return matchPath(rel)
                  }

                  // Otherwise avoid special directories "testdata" or beginning with ".", "_".
                  pathComponents := strings.Split(relToWorkingDir, string(filepath.Separator))
                  Emmanuel Odeke . unresolved

                  One more nit that I overlooked: could we please extract string(filepath.Separator) to a variable like this:

                  ```go
                  sep := string(filepath.Separator)
                  if relToWorkingDir == "." || hasAnyPrefix(relToWorkingDir, ".."+sep) {
                  // Not a special directory so can return immediately
                  return matchPath(rel)
                  }
                  			// Otherwise avoid special directories "testdata" or beginning with ".", "_".
                  pathComponents := strings.Split(relToWorkingDir, sep)
                  ```
                  Matthew Hughes

                  sorry! I managed to miss the comment when looking over your review. Addressed this with the latest change

                  Emmanuel Odeke

                  Not quite addressed: sep := string(filepath.Separator) removes the need to always invoke string(sep) every time.

                  Matthew Hughes

                  yep, I just realised I missed that 😄, fixed up with latest patch

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Emmanuel Odeke
                  Submit Requirements:
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  • requirement is not satisfiedReview-Enforcement
                  • requirement is not satisfiedTryBots-Pass
                  Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                  Gerrit-MessageType: comment
                  Gerrit-Project: go
                  Gerrit-Branch: master
                  Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                  Gerrit-Change-Number: 569895
                  Gerrit-PatchSet: 6
                  Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                  Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
                  Gerrit-Reviewer: Gopher Robot <go...@golang.org>
                  Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                  Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
                  Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
                  Gerrit-Reviewer: Than McIntosh <th...@google.com>
                  Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
                  Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                  Gerrit-Comment-Date: Sun, 24 Mar 2024 23:13:17 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  unsatisfied_requirement
                  open
                  diffy

                  Gerrit Bot (Gerrit)

                  unread,
                  Mar 24, 2024, 7:13:51 PM3/24/24
                  to Matthew Hughes, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                  Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Matloob, Sam Thanawalla and Than McIntosh

                  Gerrit Bot uploaded new patchset

                  Gerrit Bot uploaded patch set #7 to this change.
                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Emmanuel Odeke
                  • Ian Lance Taylor
                  • Michael Matloob
                  • Sam Thanawalla
                  • Than McIntosh
                  Submit Requirements:
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  • requirement is not satisfiedReview-Enforcement
                  • requirement is not satisfiedTryBots-Pass
                  Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                  Gerrit-MessageType: newpatchset
                  Gerrit-Project: go
                  Gerrit-Branch: master
                  Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                  Gerrit-Change-Number: 569895
                  Gerrit-PatchSet: 7
                  Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                  Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
                  Gerrit-Reviewer: Gopher Robot <go...@golang.org>
                  Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                  Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
                  Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
                  Gerrit-Reviewer: Than McIntosh <th...@google.com>
                  Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
                  unsatisfied_requirement
                  open
                  diffy

                  Emmanuel Odeke (Gerrit)

                  unread,
                  Mar 24, 2024, 7:24:58 PM3/24/24
                  to Gerrit Bot, Matthew Hughes, goph...@pubsubhelper.golang.org, Go LUCI, Than McIntosh, Gopher Robot, Ian Lance Taylor, Sam Thanawalla, Michael Matloob, golang-co...@googlegroups.com
                  Attention needed from Ian Lance Taylor, Matthew Hughes, Michael Matloob, Sam Thanawalla and Than McIntosh

                  Emmanuel Odeke voted and added 1 comment

                  Votes added by Emmanuel Odeke

                  Code-Review+1
                  Commit-Queue+1
                  Run-TryBot+1

                  1 comment

                  File src/cmd/go/internal/load/search.go
                  Line 60, Patchset 4: if relToWorkingDir == "." || hasAnyPrefix(relToWorkingDir, ".."+string(filepath.Separator)) {
                  // Not a special directory so can return immediately
                  return matchPath(rel)
                  }

                  // Otherwise avoid special directories "testdata" or beginning with ".", "_".
                  pathComponents := strings.Split(relToWorkingDir, string(filepath.Separator))
                  Emmanuel Odeke . resolved

                  One more nit that I overlooked: could we please extract string(filepath.Separator) to a variable like this:

                  ```go
                  sep := string(filepath.Separator)
                  if relToWorkingDir == "." || hasAnyPrefix(relToWorkingDir, ".."+sep) {
                  // Not a special directory so can return immediately
                  return matchPath(rel)
                  }
                  			// Otherwise avoid special directories "testdata" or beginning with ".", "_".
                  pathComponents := strings.Split(relToWorkingDir, sep)
                  ```
                  Matthew Hughes

                  sorry! I managed to miss the comment when looking over your review. Addressed this with the latest change

                  Emmanuel Odeke

                  Not quite addressed: sep := string(filepath.Separator) removes the need to always invoke string(sep) every time.

                  Matthew Hughes

                  yep, I just realised I missed that 😄, fixed up with latest patch

                  Emmanuel Odeke

                  Done

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Ian Lance Taylor
                  • Matthew Hughes
                  • Michael Matloob
                  • Sam Thanawalla
                  • Than McIntosh
                    Submit Requirements:
                      • requirement is not satisfiedCode-Review
                      • requirement is not satisfiedLegacy-TryBots-Pass
                      • requirement is not satisfiedNo-Unresolved-Comments
                      • requirement is not satisfiedReview-Enforcement
                      • requirement is not satisfiedTryBots-Pass
                      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                      Gerrit-MessageType: comment
                      Gerrit-Project: go
                      Gerrit-Branch: master
                      Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                      Gerrit-Change-Number: 569895
                      Gerrit-PatchSet: 7
                      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                      Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
                      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
                      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                      Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
                      Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
                      Gerrit-Reviewer: Than McIntosh <th...@google.com>
                      Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
                      Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
                      Gerrit-Attention: Matthew Hughes <matthewh...@gmail.com>
                      Gerrit-Attention: Than McIntosh <th...@google.com>
                      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                      Gerrit-Attention: Michael Matloob <mat...@golang.org>
                      Gerrit-Comment-Date: Sun, 24 Mar 2024 23:24:53 +0000
                      Gerrit-HasComments: Yes
                      Gerrit-Has-Labels: Yes
                      unsatisfied_requirement
                      open
                      diffy

                      Michael Matloob (Gerrit)

                      unread,
                      Mar 25, 2024, 11:49:05 AM3/25/24
                      to Gerrit Bot, Matthew Hughes, goph...@pubsubhelper.golang.org, Go LUCI, Gopher Robot, Emmanuel Odeke, Than McIntosh, Ian Lance Taylor, Sam Thanawalla, golang-co...@googlegroups.com
                      Attention needed from Emmanuel Odeke, Ian Lance Taylor, Matthew Hughes, Sam Thanawalla and Than McIntosh

                      Michael Matloob added 1 comment

                      Patchset-level comments
                      File-level comment, Patchset 7 (Latest):
                      Michael Matloob . resolved

                      This also affects the behavior of -gcflags and the other per package flags, right? That's probably the behavior we want but I want to double check that we're doing the right thing. I think this could be relevant because we do allow leading dots in import paths (as long as they're not in the module name https://github.com/golang/go/issues/43985) even though we won't match them when doing builds. So potentially I think (and I know this is a rare case) if a user is building something that imports a leading dot package and want to set gcflags for it, that package will be ignored.

                      Open in Gerrit

                      Related details

                      Attention is currently required from:
                      • Emmanuel Odeke
                      • Ian Lance Taylor
                      • Matthew Hughes
                      • Sam Thanawalla
                      • Than McIntosh
                      Submit Requirements:
                        • requirement is not satisfiedCode-Review
                        • requirement satisfiedLegacy-TryBots-Pass
                        • requirement is not satisfiedNo-Unresolved-Comments
                        • requirement is not satisfiedReview-Enforcement
                        • requirement is not satisfiedTryBots-Pass
                        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                        Gerrit-MessageType: comment
                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                        Gerrit-Change-Number: 569895
                        Gerrit-PatchSet: 7
                        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                        Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
                        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
                        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                        Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
                        Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
                        Gerrit-Reviewer: Than McIntosh <th...@google.com>
                        Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
                        Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
                        Gerrit-Attention: Matthew Hughes <matthewh...@gmail.com>
                        Gerrit-Attention: Than McIntosh <th...@google.com>
                        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                        Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                        Gerrit-Comment-Date: Mon, 25 Mar 2024 15:49:00 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: No
                        unsatisfied_requirement
                        satisfied_requirement
                        open
                        diffy

                        Matthew Hughes (Gerrit)

                        unread,
                        Apr 10, 2024, 4:52:04 PM4/10/24
                        to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Gopher Robot, Emmanuel Odeke, Than McIntosh, Ian Lance Taylor, Sam Thanawalla, Michael Matloob, golang-co...@googlegroups.com
                        Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Matloob, Sam Thanawalla and Than McIntosh

                        Matthew Hughes added 1 comment

                        Patchset-level comments
                        Michael Matloob . unresolved

                        This also affects the behavior of -gcflags and the other per package flags, right? That's probably the behavior we want but I want to double check that we're doing the right thing. I think this could be relevant because we do allow leading dots in import paths (as long as they're not in the module name https://github.com/golang/go/issues/43985) even though we won't match them when doing builds. So potentially I think (and I know this is a rare case) if a user is building something that imports a leading dot package and want to set gcflags for it, that package will be ignored.

                        Matthew Hughes

                        This also affects the behavior of -gcflags and the other per package flags, right?

                        Yes I believe it will

                        That's probably the behavior we want but I want to double check that we're doing the right thing


                        Maybe it's worth looking to see if we can limit this functionality to just the -coverpkg flag?

                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Emmanuel Odeke
                        • Ian Lance Taylor
                        • Michael Matloob
                        • Sam Thanawalla
                        • Than McIntosh
                        Gerrit-Attention: Than McIntosh <th...@google.com>
                        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                        Gerrit-Attention: Michael Matloob <mat...@golang.org>
                        Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                        Gerrit-Comment-Date: Wed, 10 Apr 2024 20:51:54 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: No
                        Comment-In-Reply-To: Michael Matloob <mat...@golang.org>
                        unsatisfied_requirement
                        satisfied_requirement
                        open
                        diffy

                        Gerrit Bot (Gerrit)

                        unread,
                        Apr 11, 2024, 3:13:04 PM4/11/24
                        to Matthew Hughes, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                        Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Matloob, Sam Thanawalla and Than McIntosh

                        Gerrit Bot uploaded new patchset

                        Gerrit Bot uploaded patch set #8 to this change.
                        Following approvals got outdated and were removed:
                        • Legacy-TryBots-Pass: TryBot-Result+1 by Gopher Robot, Run-TryBot+1 by Emmanuel Odeke
                        • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI

                        Related details

                        Attention is currently required from:
                        • Emmanuel Odeke
                        • Ian Lance Taylor
                        • Michael Matloob
                        • Sam Thanawalla
                        • Than McIntosh
                        Submit Requirements:
                          • requirement is not satisfiedCode-Review
                          • requirement is not satisfiedNo-Unresolved-Comments
                          • requirement is not satisfiedReview-Enforcement
                          • requirement is not satisfiedTryBots-Pass
                          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                          Gerrit-MessageType: newpatchset
                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                          Gerrit-Change-Number: 569895
                          Gerrit-PatchSet: 8
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
                          Gerrit-Reviewer: Gopher Robot <go...@golang.org>
                          Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                          Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
                          Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
                          Gerrit-Reviewer: Than McIntosh <th...@google.com>
                          Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
                          Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
                          Gerrit-Attention: Than McIntosh <th...@google.com>
                          Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                          unsatisfied_requirement
                          open
                          diffy

                          Gerrit Bot (Gerrit)

                          unread,
                          Apr 11, 2024, 3:19:30 PM4/11/24
                          to Matthew Hughes, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                          Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Matloob, Sam Thanawalla and Than McIntosh

                          Gerrit Bot uploaded new patchset

                          Gerrit Bot uploaded patch set #9 to this change.
                          Open in Gerrit

                          Related details

                          Attention is currently required from:
                          • Emmanuel Odeke
                          • Ian Lance Taylor
                          • Michael Matloob
                          • Sam Thanawalla
                          • Than McIntosh
                          Submit Requirements:
                          • requirement is not satisfiedCode-Review
                          • requirement is not satisfiedNo-Unresolved-Comments
                          • requirement is not satisfiedReview-Enforcement
                          • requirement is not satisfiedTryBots-Pass
                          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                          Gerrit-MessageType: newpatchset
                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                          Gerrit-Change-Number: 569895
                          Gerrit-PatchSet: 9
                          unsatisfied_requirement
                          open
                          diffy

                          Matthew Hughes (Gerrit)

                          unread,
                          Apr 11, 2024, 3:37:35 PM4/11/24
                          to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Gopher Robot, Emmanuel Odeke, Than McIntosh, Ian Lance Taylor, Sam Thanawalla, Michael Matloob, golang-co...@googlegroups.com
                          Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Matloob, Sam Thanawalla and Than McIntosh

                          Matthew Hughes added 1 comment

                          Patchset-level comments
                          File-level comment, Patchset 7:
                          Michael Matloob . resolved

                          This also affects the behavior of -gcflags and the other per package flags, right? That's probably the behavior we want but I want to double check that we're doing the right thing. I think this could be relevant because we do allow leading dots in import paths (as long as they're not in the module name https://github.com/golang/go/issues/43985) even though we won't match them when doing builds. So potentially I think (and I know this is a rare case) if a user is building something that imports a leading dot package and want to set gcflags for it, that package will be ignored.

                          Matthew Hughes

                          This also affects the behavior of -gcflags and the other per package flags, right?

                          Yes I believe it will

                          That's probably the behavior we want but I want to double check that we're doing the right thing


                          Maybe it's worth looking to see if we can limit this functionality to just the -coverpkg flag?

                          Matthew Hughes

                          I've added the latest change (which also rebased on top of master) to limit the changes in package matching to just the -coverpkg flag

                          Open in Gerrit

                          Related details

                          Attention is currently required from:
                          • Emmanuel Odeke
                          • Ian Lance Taylor
                          • Michael Matloob
                          • Sam Thanawalla
                          • Than McIntosh
                          Submit Requirements:
                          • requirement is not satisfiedCode-Review
                          • requirement is not satisfiedNo-Unresolved-Comments
                          • requirement is not satisfiedReview-Enforcement
                          • requirement is not satisfiedTryBots-Pass
                          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                          Gerrit-MessageType: comment
                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                          Gerrit-Change-Number: 569895
                          Gerrit-PatchSet: 9
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
                          Gerrit-Reviewer: Gopher Robot <go...@golang.org>
                          Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                          Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
                          Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
                          Gerrit-Reviewer: Than McIntosh <th...@google.com>
                          Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
                          Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
                          Gerrit-Attention: Than McIntosh <th...@google.com>
                          Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                          Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                          Gerrit-Attention: Michael Matloob <mat...@golang.org>
                          Gerrit-Comment-Date: Thu, 11 Apr 2024 19:37:28 +0000
                          Gerrit-HasComments: Yes
                          Gerrit-Has-Labels: No
                          Comment-In-Reply-To: Matthew Hughes <matthewh...@gmail.com>
                          Comment-In-Reply-To: Michael Matloob <mat...@golang.org>
                          unsatisfied_requirement
                          open
                          diffy

                          Than McIntosh (Gerrit)

                          unread,
                          Apr 15, 2024, 8:50:07 AM4/15/24
                          to Gerrit Bot, Matthew Hughes, goph...@pubsubhelper.golang.org, Than McIntosh, Go LUCI, Gopher Robot, Emmanuel Odeke, Ian Lance Taylor, Sam Thanawalla, Michael Matloob, golang-co...@googlegroups.com
                          Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Matloob and Sam Thanawalla

                          Than McIntosh voted Commit-Queue+1

                          Commit-Queue+1
                          Open in Gerrit

                          Related details

                          Attention is currently required from:
                          • Emmanuel Odeke
                          • Ian Lance Taylor
                          • Michael Matloob
                          • Sam Thanawalla
                          Submit Requirements:
                          • requirement is not satisfiedCode-Review
                          • requirement is not satisfiedNo-Unresolved-Comments
                          • requirement is not satisfiedReview-Enforcement
                          • requirement is not satisfiedTryBots-Pass
                          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                          Gerrit-MessageType: comment
                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                          Gerrit-Change-Number: 569895
                          Gerrit-PatchSet: 9
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
                          Gerrit-Reviewer: Gopher Robot <go...@golang.org>
                          Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                          Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
                          Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
                          Gerrit-Reviewer: Than McIntosh <th...@google.com>
                          Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
                          Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
                          Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                          Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                          Gerrit-Attention: Michael Matloob <mat...@golang.org>
                          Gerrit-Comment-Date: Mon, 15 Apr 2024 12:49:58 +0000
                          Gerrit-HasComments: No
                          Gerrit-Has-Labels: Yes
                          unsatisfied_requirement
                          open
                          diffy

                          Gerrit Bot (Gerrit)

                          unread,
                          May 28, 2024, 1:40:13 PM5/28/24
                          to Matthew Hughes, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                          Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Matloob, Sam Thanawalla and Than McIntosh

                          Gerrit Bot uploaded new patchset

                          Gerrit Bot uploaded patch set #10 to this change.
                          Following approvals got outdated and were removed:
                          • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
                          Open in Gerrit

                          Related details

                          Attention is currently required from:
                          • Emmanuel Odeke
                          • Ian Lance Taylor
                          • Michael Matloob
                          • Sam Thanawalla
                          • Than McIntosh
                          Submit Requirements:
                          • requirement is not satisfiedCode-Review
                          • requirement is not satisfiedNo-Unresolved-Comments
                          • requirement is not satisfiedReview-Enforcement
                          • requirement is not satisfiedTryBots-Pass
                          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                          Gerrit-MessageType: newpatchset
                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                          Gerrit-Change-Number: 569895
                          Gerrit-PatchSet: 10
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
                          Gerrit-Reviewer: Gopher Robot <go...@golang.org>
                          Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                          Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
                          Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
                          Gerrit-Reviewer: Than McIntosh <th...@google.com>
                          Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
                          Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
                          Gerrit-Attention: Than McIntosh <th...@google.com>
                          unsatisfied_requirement
                          open
                          diffy

                          Gerrit Bot (Gerrit)

                          unread,
                          Jul 14, 2024, 3:50:32 PM7/14/24
                          to Matthew Hughes, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                          Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Matloob, Sam Thanawalla and Than McIntosh

                          Gerrit Bot uploaded new patchset

                          Gerrit Bot uploaded patch set #11 to this change.
                          Open in Gerrit

                          Related details

                          Attention is currently required from:
                          • Emmanuel Odeke
                          • Ian Lance Taylor
                          • Michael Matloob
                          • Sam Thanawalla
                          • Than McIntosh
                          Submit Requirements:
                          • requirement is not satisfiedCode-Review
                          • requirement is not satisfiedNo-Unresolved-Comments
                          • requirement is not satisfiedReview-Enforcement
                          • requirement is not satisfiedTryBots-Pass
                          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                          Gerrit-MessageType: newpatchset
                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                          Gerrit-Change-Number: 569895
                          Gerrit-PatchSet: 11
                          unsatisfied_requirement
                          open
                          diffy

                          Funda Secgin (Gerrit)

                          unread,
                          Jul 14, 2024, 4:38:56 PM7/14/24
                          to Gerrit Bot, Matthew Hughes, goph...@pubsubhelper.golang.org, Go LUCI, Than McIntosh, Gopher Robot, Emmanuel Odeke, Ian Lance Taylor, Sam Thanawalla, Michael Matloob, golang-co...@googlegroups.com
                          Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Matloob, Sam Thanawalla and Than McIntosh

                          Funda Secgin voted Code-Review+1

                          Code-Review+1
                          Open in Gerrit

                          Related details

                          Attention is currently required from:
                          • Emmanuel Odeke
                          • Ian Lance Taylor
                          • Michael Matloob
                          • Sam Thanawalla
                          • Than McIntosh
                          Submit Requirements:
                          • requirement is not satisfiedCode-Review
                          • requirement is not satisfiedNo-Unresolved-Comments
                          • requirement is not satisfiedReview-Enforcement
                          • requirement is not satisfiedTryBots-Pass
                          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                          Gerrit-MessageType: comment
                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                          Gerrit-Change-Number: 569895
                          Gerrit-PatchSet: 11
                          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                          Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
                          Gerrit-Reviewer: Funda Secgin <fundas...@gmail.com>
                          Gerrit-Reviewer: Gopher Robot <go...@golang.org>
                          Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                          Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
                          Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
                          Gerrit-Reviewer: Than McIntosh <th...@google.com>
                          Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
                          Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
                          Gerrit-Attention: Than McIntosh <th...@google.com>
                          Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                          Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                          Gerrit-Attention: Michael Matloob <mat...@golang.org>
                          Gerrit-Comment-Date: Sun, 14 Jul 2024 20:38:49 +0000
                          Gerrit-HasComments: No
                          Gerrit-Has-Labels: Yes
                          unsatisfied_requirement
                          open
                          diffy

                          Funda Secgin (Gerrit)

                          unread,
                          Jul 22, 2024, 3:57:09 PM7/22/24
                          to Gerrit Bot, Matthew Hughes, goph...@pubsubhelper.golang.org, Go LUCI, Than McIntosh, Gopher Robot, Emmanuel Odeke, Ian Lance Taylor, Sam Thanawalla, Michael Matloob, golang-co...@googlegroups.com
                          Attention needed from Emmanuel Odeke, Ian Lance Taylor, Matthew Hughes, Michael Matloob, Sam Thanawalla and Than McIntosh

                          Funda Secgin added 2 comments

                          Patchset-level comments
                          File-level comment, Patchset 4:
                          Gopher Robot . resolved

                          TryBots beginning. Status page: https://farmer.golang.org/try?commit=4f35b335

                          Gopher Robot

                          1 of 48 TryBots failed.
                          Failed on openbsd-amd64-72: https://storage.googleapis.com/go-build-log/4f35b335/openbsd-amd64-72_1c3aaacc.log

                          Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test *exactly* your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.

                          Matthew Hughes

                          I see similar looking failures on older builds. I've rebased my changed on master (it looks like recent builds are running ok on this arch)

                          Funda Secgin

                          Done

                          File src/cmd/go/go_test.go
                          Line 2782, Patchset 1:func TestCoverpkgIngoresSpecialDirs(t *testing.T) {
                          Than McIntosh . resolved

                          Is there a chance you can write this as a script test instead of a hand-coded test? For this sort of scenario (where you have to build a program and do testing) the script test would probably be a lot more readable. If using the script engine doesn't work for some reason we can fall back to this.

                          Matthew Hughes

                          Ah, I didn't know script tests were a thing. From a glance these look to be under src/cmd/go/testdata/script, is that correct? If so I'll have a look over there and try and build something

                          Than McIntosh

                          Yes, testdata/script/<testcase>.txt.

                          You could use testdata/script/cover_swig.txt or testdata/script/cover_coverpkg_with_init.txt as examples.

                          Matthew Hughes

                          Yes, testdata/script/<testcase>.txt.

                          You could use testdata/script/cover_swig.txt or testdata/script/cover_coverpkg_with_init.txt as examples.

                          Thanks I gave this a shot with the latest patchset

                          Funda Secgin

                          Done

                          Open in Gerrit

                          Related details

                          Attention is currently required from:
                          • Emmanuel Odeke
                          • Ian Lance Taylor
                          • Matthew Hughes
                          • Michael Matloob
                          • Sam Thanawalla
                          • Than McIntosh
                            Submit Requirements:
                              • requirement is not satisfiedCode-Review
                              • requirement satisfiedNo-Unresolved-Comments
                              • requirement is not satisfiedReview-Enforcement
                              • requirement is not satisfiedTryBots-Pass
                              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                              Gerrit-MessageType: comment
                              Gerrit-Project: go
                              Gerrit-Branch: master
                              Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                              Gerrit-Change-Number: 569895
                              Gerrit-PatchSet: 11
                              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                              Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
                              Gerrit-Reviewer: Funda Secgin <fundas...@gmail.com>
                              Gerrit-Reviewer: Gopher Robot <go...@golang.org>
                              Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                              Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
                              Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
                              Gerrit-Reviewer: Than McIntosh <th...@google.com>
                              Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
                              Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
                              Gerrit-Attention: Matthew Hughes <matthewh...@gmail.com>
                              Gerrit-Attention: Than McIntosh <th...@google.com>
                              Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                              Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                              Gerrit-Attention: Michael Matloob <mat...@golang.org>
                              Gerrit-Comment-Date: Mon, 22 Jul 2024 19:57:01 +0000
                              Gerrit-HasComments: Yes
                              Gerrit-Has-Labels: No
                              Comment-In-Reply-To: Gopher Robot <go...@golang.org>
                              Comment-In-Reply-To: Matthew Hughes <matthewh...@gmail.com>
                              Comment-In-Reply-To: Than McIntosh <th...@google.com>
                              unsatisfied_requirement
                              satisfied_requirement
                              open
                              diffy

                              Matthew Hughes (Gerrit)

                              unread,
                              Apr 9, 2025, 4:00:38 PMApr 9
                              to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Gopher Robot, Emmanuel Odeke, Ian Lance Taylor, Sam Thanawalla, Michael Matloob, golang-co...@googlegroups.com
                              Attention needed from Emmanuel Odeke, Ian Lance Taylor, Michael Matloob, Sam Thanawalla and Than McIntosh

                              Matthew Hughes added 1 comment

                              Patchset-level comments
                              File-level comment, Patchset 11 (Latest):
                              Matthew Hughes . resolved

                              I've just rebased these changes on latest master (didn't require any changes/conflict resolutions0. I think I've addressed all the feedback, but let me know if there's anything I've missed/anything else outstanding on this changeset

                              Open in Gerrit

                              Related details

                              Attention is currently required from:
                              • Emmanuel Odeke
                              • Ian Lance Taylor
                              Gerrit-Attention: Than McIntosh <th...@google.com>
                              Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                              Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                              Gerrit-Attention: Michael Matloob <mat...@golang.org>
                              Gerrit-Comment-Date: Wed, 09 Apr 2025 20:00:31 +0000
                              Gerrit-HasComments: Yes
                              Gerrit-Has-Labels: No
                              unsatisfied_requirement
                              satisfied_requirement
                              open
                              diffy

                              Gerrit Bot (Gerrit)

                              unread,
                              Apr 9, 2025, 4:04:54 PMApr 9
                              to Matthew Hughes, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                              Attention needed from Emmanuel Odeke, Funda Secgin, Ian Lance Taylor, Michael Matloob, Sam Thanawalla and Than McIntosh

                              Gerrit Bot uploaded new patchset

                              Gerrit Bot uploaded patch set #12 to this change.
                              Open in Gerrit

                              Related details

                              Attention is currently required from:
                              • Emmanuel Odeke
                              • Funda Secgin
                              • Ian Lance Taylor
                              • Michael Matloob
                              • Sam Thanawalla
                              • Than McIntosh
                              Submit Requirements:
                              • requirement is not satisfiedCode-Review
                              • requirement satisfiedNo-Unresolved-Comments
                              • requirement is not satisfiedReview-Enforcement
                              • requirement is not satisfiedTryBots-Pass
                              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                              Gerrit-MessageType: newpatchset
                              Gerrit-Project: go
                              Gerrit-Branch: master
                              Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                              Gerrit-Change-Number: 569895
                              Gerrit-PatchSet: 12
                              Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                              Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
                              Gerrit-Reviewer: Funda Secgin <fundas...@gmail.com>
                              Gerrit-Reviewer: Gopher Robot <go...@golang.org>
                              Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                              Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
                              Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
                              Gerrit-Reviewer: Than McIntosh <th...@google.com>
                              Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
                              Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
                              Gerrit-Attention: Funda Secgin <fundas...@gmail.com>
                              unsatisfied_requirement
                              satisfied_requirement
                              open
                              diffy

                              Michael Matloob (Gerrit)

                              unread,
                              Nov 3, 2025, 4:41:43 PM (3 days ago) Nov 3
                              to Matthew Hughes, Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Than McIntosh, Gopher Robot, Emmanuel Odeke, Ian Lance Taylor, Sam Thanawalla, golang-co...@googlegroups.com
                              Attention needed from Emmanuel Odeke, Funda Secgin, Ian Lance Taylor, Sam Thanawalla and Than McIntosh

                              Michael Matloob added 1 comment

                              File src/cmd/go/internal/test/test.go
                              Line 2241, Patchset 12 (Latest): // Otherwise avoid special directories "testdata" or beginning with ".", "_".
                              pathComponents := strings.Split(rel, sep)

                              for _, elem := range pathComponents {
                              if hasAnyPrefix(elem, ".", "_") || elem == "testdata" {
                              return true
                              }
                              }
                              Michael Matloob . unresolved

                              We should try to keep the logic here in line with the logic in modload.matchPackages (look for the comment `// Avoid .foo, _foo, and testdata subdirectory trees.`)

                              We'll need to also make sure that we avoid 'ignored' directories (see the `ignorePatternsMap` code in that block referenced above)

                              Open in Gerrit

                              Related details

                              Attention is currently required from:
                              • Emmanuel Odeke
                              • Funda Secgin
                              • Ian Lance Taylor
                              • Sam Thanawalla
                              • Than McIntosh
                              Submit Requirements:
                                • requirement is not satisfiedCode-Review
                                • requirement is not satisfiedNo-Unresolved-Comments
                                • requirement is not satisfiedReview-Enforcement
                                • requirement is not satisfiedTryBots-Pass
                                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                Gerrit-MessageType: comment
                                Gerrit-Project: go
                                Gerrit-Branch: master
                                Gerrit-Change-Id: I8040caa6e16bfce4bca9da4f5f4e74eb9456c0e1
                                Gerrit-Change-Number: 569895
                                Gerrit-PatchSet: 12
                                Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
                                Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
                                Gerrit-Reviewer: Funda Secgin <fundas...@gmail.com>
                                Gerrit-Reviewer: Gopher Robot <go...@golang.org>
                                Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
                                Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
                                Gerrit-Reviewer: Sam Thanawalla <samtha...@google.com>
                                Gerrit-Reviewer: Than McIntosh <th...@google.com>
                                Gerrit-CC: Matthew Hughes <matthewh...@gmail.com>
                                Gerrit-Attention: Emmanuel Odeke <emma...@orijtech.com>
                                Gerrit-Attention: Than McIntosh <th...@google.com>
                                Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
                                Gerrit-Attention: Funda Secgin <fundas...@gmail.com>
                                Gerrit-Attention: Sam Thanawalla <samtha...@google.com>
                                Gerrit-Comment-Date: Mon, 03 Nov 2025 21:41:38 +0000
                                Gerrit-HasComments: Yes
                                Gerrit-Has-Labels: No
                                unsatisfied_requirement
                                open
                                diffy
                                Reply all
                                Reply to author
                                Forward
                                0 new messages