Skip to content

cmd/go/internal/modload: avoid calling strings.HasPrefix twice in *MainModuleSet.DirImportPath #63893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

cmd/go/internal/modload: avoid calling strings.HasPrefix twice in *MainModuleSet.DirImportPath #63893

wants to merge 1 commit into from

Conversation

callthingsoff
Copy link
Contributor

@callthingsoff callthingsoff commented Nov 2, 2023

Since TrimPrefix uses HasPrefix internally.

…et.DirImportPath

To avoid calling strings.HasPrefix twice, don't use strings.TrimPrefix.
@gopherbot
Copy link
Contributor

This PR (HEAD: 74bcfff) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/539096.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/539096.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Jes Cok:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/539096.
After addressing review feedback, remember to publish your drafts!

@callthingsoff callthingsoff changed the title cmd/go/internal/modload: don't use strings.TrimPrefix in *MainModuleS… cmd/go/internal/modload: avoid calling strings.HasPrefix twice in *MainModuleset.DirImportPath Nov 4, 2023
@callthingsoff callthingsoff changed the title cmd/go/internal/modload: avoid calling strings.HasPrefix twice in *MainModuleset.DirImportPath cmd/go/internal/modload: avoid calling strings.HasPrefix twice in * MainModuleSet.DirImportPath Nov 4, 2023
@callthingsoff callthingsoff changed the title cmd/go/internal/modload: avoid calling strings.HasPrefix twice in * MainModuleSet.DirImportPath cmd/go/internal/modload: avoid calling strings.HasPrefix twice in *MainModuleSet.DirImportPath Nov 4, 2023
@gopherbot
Copy link
Contributor

Message from Jes Cok:

Patch Set 4: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/539096.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 4:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/539096.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 4: TryBot-Result+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/539096.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Bryan Mills:

Patch Set 4: Auto-Submit+1 Code-Review+2 Commit-Queue+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/539096.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 4:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2023-11-07T22:21:07Z","revision":"350630de8f7a9e374dafe9ae6cad4252d8a2458b"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/539096.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Bryan Mills:

Patch Set 4: -Commit-Queue


Please don’t reply on this GitHub thread. Visit golang.org/cl/539096.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 4:

This CL has failed the run. Reason:

Tryjob golang/try/gotip-wasip1-wasm_wasmtime has failed with summary (view all results):


FAILURE

error: shard 1: failed to run "go tool dist test -json": exit status 1
shard 2: failed to run "go tool dist test -json": exit status 1
shard 3: failed to run "go tool dist test -json": exit status 1
shard 4: failed to run "go tool dist test -json": exit status 1


Please don’t reply on this GitHub thread. Visit golang.org/cl/539096.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go LUCI:

Patch Set 4: LUCI-TryBot-Result-1


Please don’t reply on this GitHub thread. Visit golang.org/cl/539096.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Nov 8, 2023
…inModuleSet.DirImportPath

Since TrimPrefix uses HasPrefix internally.

Change-Id: Ifadb99dd9192578056636adacaccc9d88a1c1f32
GitHub-Last-Rev: 74bcfff
GitHub-Pull-Request: #63893
Reviewed-on: https://go-review.googlesource.com/c/go/+/539096
Run-TryBot: Jes Cok <[email protected]>
Auto-Submit: Bryan Mills <[email protected]>
Reviewed-by: Heschi Kreinick <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/539096 has been merged.

@gopherbot gopherbot closed this Nov 8, 2023
@callthingsoff callthingsoff deleted the load_un_use_strings.TrimPrefix branch November 8, 2023 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants