]> Cypherpunks repositories - gostls13.git/commit
slices: simplify slice expression for Replace
authorJes Cok <xigua67damn@gmail.com>
Sat, 30 Mar 2024 02:32:20 +0000 (10:32 +0800)
committerGopher Robot <gobot@golang.org>
Wed, 3 Apr 2024 17:01:23 +0000 (17:01 +0000)
commit170862d68377ac04a35223521ce9e450007a6032
tree7669613184309e75906dfb54430fbbe977c6d3e1
parentd8e47e257e40ab03c5eaf2316eaea4cb83e650c3
slices: simplify slice expression for Replace

A slice expression of the form:
s[a:len(s)]
will be simplified to:
s[a:]
This is one of the simplifications that "gofmt -s" applies.

See https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/simplifyslice

Change-Id: Ib3c01ecf24b84333fd1993a343450fc57fb8ac84
Reviewed-on: https://go-review.googlesource.com/c/go/+/575335
Reviewed-by: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Valentin Deleplace <deleplace@google.com>
src/slices/slices.go