Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(93)

Issue 7239044: code review 7239044: bytes, strings: add TrimPrefix and TrimSuffix (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 5 months ago by bradfitz
Modified:
12 years, 5 months ago
Reviewers:
CC:
rsc, kevlar, golang-dev
Visibility:
Public.

Description

bytes, strings: add TrimPrefix and TrimSuffix Everybody either gets confused and thinks this is TrimLeft/TrimRight or does this by hand which gets repetitive looking.

Patch Set 1 #

Patch Set 2 : diff -r 9379ab966cb2 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 9379ab966cb2 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 59521f9a2f0f https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r 59521f9a2f0f https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r 59521f9a2f0f https://go.googlecode.com/hg/ #

Patch Set 7 : diff -r 59521f9a2f0f https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 8 : diff -r c9e8491bbfce https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -54 lines) Patch
M src/cmd/api/goapi.go View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M src/cmd/cgo/gcc.go View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M src/cmd/cgo/godefs.go View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/fix/typecheck.go View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download
M src/cmd/go/testflag.go View 1 2 3 4 5 6 7 1 chunk +1 line, -3 lines 0 comments Download
M src/cmd/godoc/dirtrees.go View 1 2 2 chunks +3 lines, -10 lines 0 comments Download
M src/cmd/godoc/filesystem.go View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download
M src/cmd/godoc/godoc.go View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M src/cmd/godoc/main.go View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/vet/method.go View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download
M src/pkg/bytes/bytes.go View 1 2 3 1 chunk +18 lines, -0 lines 0 comments Download
M src/pkg/bytes/bytes_test.go View 1 2 3 4 3 chunks +18 lines, -4 lines 0 comments Download
M src/pkg/bytes/example_test.go View 1 2 3 4 5 1 chunk +17 lines, -0 lines 0 comments Download
M src/pkg/exp/html/parse_test.go View 1 2 3 4 5 6 1 chunk +1 line, -4 lines 0 comments Download
M src/pkg/go/printer/printer.go View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download
M src/pkg/go/types/gcimporter.go View 1 2 3 4 5 6 1 chunk +1 line, -4 lines 0 comments Download
M src/pkg/net/http/pprof/pprof.go View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/net/http/response.go View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download
M src/pkg/strings/example_test.go View 1 2 3 4 1 chunk +16 lines, -0 lines 0 comments Download
M src/pkg/strings/strings.go View 1 1 chunk +18 lines, -0 lines 0 comments Download
M src/pkg/strings/strings_test.go View 1 3 chunks +12 lines, -4 lines 0 comments Download

Messages

Total messages: 10
bradfitz
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 5 months ago (2013-01-30 19:25:32 UTC) #1
bradfitz
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 5 months ago (2013-01-30 19:50:07 UTC) #2
bradfitz
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 5 months ago (2013-01-30 20:33:48 UTC) #3
rsc
Please add examples.
12 years, 5 months ago (2013-01-30 20:35:17 UTC) #4
bradfitz
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 5 months ago (2013-01-30 20:58:33 UTC) #5
bradfitz
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 5 months ago (2013-01-30 21:17:57 UTC) #6
bradfitz
Now with examples and all the callers I could easily find fixed up. On Wed, ...
12 years, 5 months ago (2013-01-30 21:18:53 UTC) #7
dsymonds
OMG my hero. the number of times I've written that code...
12 years, 5 months ago (2013-01-30 21:54:55 UTC) #8
kevlar
LGTM Awesome :) https://codereview.appspot.com/7239044/diff/11002/src/pkg/strings/example_test.go File src/pkg/strings/example_test.go (right): https://codereview.appspot.com/7239044/diff/11002/src/pkg/strings/example_test.go#newcode183 src/pkg/strings/example_test.go:183: func ExampleTrimSuffix() { I would include ...
12 years, 5 months ago (2013-01-30 21:55:01 UTC) #9
bradfitz
12 years, 5 months ago (2013-02-01 16:41:32 UTC) #10
*** Submitted as https://code.google.com/p/go/source/detail?r=c7353c98694b ***

bytes, strings: add TrimPrefix and TrimSuffix

Everybody either gets confused and thinks this is
TrimLeft/TrimRight or does this by hand which gets
repetitive looking.

R=rsc, kevlar
CC=golang-dev
https://codereview.appspot.com/7239044
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b