Skip to content

Commit fdace02

Browse files
authored
Merge pull request #19 from golang/master
[pull] master from golang:master
2 parents 388aab4 + 1644917 commit fdace02

9 files changed

Lines changed: 21 additions & 61 deletions

File tree

src/cmd/go/internal/cache/prog.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ func (c *ProgCache) send(ctx context.Context, req *cacheprog.Request) (*cachepro
204204
func (c *ProgCache) writeToChild(req *cacheprog.Request, resc chan<- *cacheprog.Response) (err error) {
205205
c.mu.Lock()
206206
if c.inFlight == nil {
207+
c.mu.Unlock()
207208
return errCacheprogClosed
208209
}
209210
c.nextID++

src/cmd/go/internal/modfetch/cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ func rewriteVersionList(ctx context.Context, dir string) (err error) {
781781
}
782782
if fi, err := f.Stat(); err == nil && int(fi.Size()) == buf.Len() {
783783
old := make([]byte, buf.Len()+1)
784-
if n, err := f.ReadAt(old, 0); err == io.EOF && n == buf.Len() && bytes.Equal(buf.Bytes(), old) {
784+
if n, err := f.ReadAt(old, 0); err == io.EOF && n == buf.Len() && bytes.Equal(buf.Bytes(), old[:n]) {
785785
return nil // No edit needed.
786786
}
787787
}

src/html/template/transition.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ func tJSDelimited(c context, s []byte) (context, int) {
426426
// If "</script" appears in a regex literal, the '/' should not
427427
// close the regex literal, and it will later be escaped to
428428
// "\x3C/script" in escapeText.
429-
if i > 0 && i+7 <= len(s) && bytes.Equal(bytes.ToLower(s[i-1:i+7]), []byte("</script")) {
429+
if i > 0 && i+7 <= len(s) && bytes.EqualFold(s[i-1:i+7], []byte("</script")) {
430430
i++
431431
} else if !inCharset {
432432
c.state, c.jsCtx = stateJS, jsCtxDivOp

src/internal/goexperiment/exp_goroutineleakprofile_off.go

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/internal/goexperiment/exp_goroutineleakprofile_on.go

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/net/http/pprof/pprof.go

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ import (
7777
"fmt"
7878
"html"
7979
"internal/godebug"
80-
"internal/goexperiment"
8180
"internal/profile"
8281
"io"
8382
"log"
@@ -362,22 +361,17 @@ var profileSupportsDelta = map[handler]bool{
362361
}
363362

364363
var profileDescriptions = map[string]string{
365-
"allocs": "A sampling of all past memory allocations",
366-
"block": "Stack traces that led to blocking on synchronization primitives",
367-
"cmdline": "The command line invocation of the current program",
368-
"goroutine": "Stack traces of all current goroutines. Use debug=2 as a query parameter to export in the same format as an unrecovered panic.",
369-
"heap": "A sampling of memory allocations of live objects. You can specify the gc GET parameter to run GC before taking the heap sample.",
370-
"mutex": "Stack traces of holders of contended mutexes",
371-
"profile": "CPU profile. You can specify the duration in the seconds GET parameter. After you get the profile file, use the go tool pprof command to investigate the profile.",
372-
"symbol": "Maps given program counters to function names. Counters can be specified in a GET raw query or POST body, multiple counters are separated by '+'.",
373-
"threadcreate": "Stack traces that led to the creation of new OS threads",
374-
"trace": "A trace of execution of the current program. You can specify the duration in the seconds GET parameter. After you get the trace file, use the go tool trace command to investigate the trace.",
375-
}
376-
377-
func init() {
378-
if goexperiment.GoroutineLeakProfile {
379-
profileDescriptions["goroutineleak"] = "Stack traces of all leaked goroutines. Use debug=2 as a query parameter to export in the same format as an unrecovered panic."
380-
}
364+
"allocs": "A sampling of all past memory allocations",
365+
"block": "Stack traces that led to blocking on synchronization primitives",
366+
"cmdline": "The command line invocation of the current program",
367+
"goroutine": "Stack traces of all current goroutines. Use debug=2 as a query parameter to export in the same format as an unrecovered panic.",
368+
"heap": "A sampling of memory allocations of live objects. You can specify the gc GET parameter to run GC before taking the heap sample.",
369+
"mutex": "Stack traces of holders of contended mutexes",
370+
"profile": "CPU profile. You can specify the duration in the seconds GET parameter. After you get the profile file, use the go tool pprof command to investigate the profile.",
371+
"symbol": "Maps given program counters to function names. Counters can be specified in a GET raw query or POST body, multiple counters are separated by '+'.",
372+
"threadcreate": "Stack traces that led to the creation of new OS threads",
373+
"trace": "A trace of execution of the current program. You can specify the duration in the seconds GET parameter. After you get the trace file, use the go tool trace command to investigate the trace.",
374+
"goroutineleak": "Stack traces of all leaked goroutines. Use debug=2 as a query parameter to export in the same format as an unrecovered panic.",
381375
}
382376

383377
type profileEntry struct {

src/runtime/crash_test.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -194,21 +194,6 @@ func buildTestProg(t *testing.T, binary string, flags ...string) (string, error)
194194
cmd.Dir = "testdata/" + binary
195195
cmd = testenv.CleanCmdEnv(cmd)
196196

197-
// If tests need any experimental flags, add them here.
198-
//
199-
// TODO(vsaioc): Remove `goroutineleakprofile` once the feature is no longer experimental.
200-
edited := false
201-
for i := range cmd.Env {
202-
e := cmd.Env[i]
203-
if _, vars, ok := strings.Cut(e, "GOEXPERIMENT="); ok {
204-
cmd.Env[i] = "GOEXPERIMENT=" + vars + ",goroutineleakprofile"
205-
edited, _ = true, vars
206-
}
207-
}
208-
if !edited {
209-
cmd.Env = append(cmd.Env, "GOEXPERIMENT=goroutineleakprofile")
210-
}
211-
212197
out, err := cmd.CombinedOutput()
213198
if err != nil {
214199
target.err = fmt.Errorf("building %s %v: %v\n%s", binary, flags, err, out)

src/runtime/goroutineleakprofile_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,6 @@ func TestGoroutineLeakProfile(t *testing.T) {
509509

510510
cmdEnv := []string{
511511
"GODEBUG=asyncpreemptoff=1",
512-
"GOEXPERIMENT=goroutineleakprofile",
513512
}
514513

515514
if tcase.simple {

src/runtime/pprof/pprof.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ import (
8080
"cmp"
8181
"fmt"
8282
"internal/abi"
83-
"internal/goexperiment"
8483
"internal/profilerecord"
8584
"io"
8685
"runtime"
@@ -257,15 +256,13 @@ func lockProfiles() {
257256
if profiles.m == nil {
258257
// Initial built-in profiles.
259258
profiles.m = map[string]*Profile{
260-
"goroutine": goroutineProfile,
261-
"threadcreate": threadcreateProfile,
262-
"heap": heapProfile,
263-
"allocs": allocsProfile,
264-
"block": blockProfile,
265-
"mutex": mutexProfile,
266-
}
267-
if goexperiment.GoroutineLeakProfile {
268-
profiles.m["goroutineleak"] = goroutineLeakProfile
259+
"goroutine": goroutineProfile,
260+
"threadcreate": threadcreateProfile,
261+
"heap": heapProfile,
262+
"allocs": allocsProfile,
263+
"block": blockProfile,
264+
"mutex": mutexProfile,
265+
"goroutineleak": goroutineLeakProfile,
269266
}
270267
}
271268
}

0 commit comments

Comments
 (0)