From 38583c233f23eb9728ebb352826157a57fee9355 Mon Sep 17 00:00:00 2001 From: Joe Shaw Date: Thu, 1 Sep 2022 14:02:36 -0400 Subject: [PATCH] runtime/pprof, runtime/trace: stub some additional functions These are necessary to import some parts of the net/http package. --- src/runtime/pprof/pprof.go | 15 +++++++++++++-- src/runtime/trace/trace.go | 13 +++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 src/runtime/trace/trace.go diff --git a/src/runtime/pprof/pprof.go b/src/runtime/pprof/pprof.go index 53ebc88a8c..c56d553718 100644 --- a/src/runtime/pprof/pprof.go +++ b/src/runtime/pprof/pprof.go @@ -10,8 +10,7 @@ import ( var ErrUnimplemented = errors.New("runtime/pprof: unimplemented") -type Profile struct { -} +type Profile struct{} func StartCPUProfile(w io.Writer) error { return nil @@ -28,6 +27,18 @@ func Lookup(name string) *Profile { return nil } +func (p *Profile) Name() string { + return "" +} + +func (p *Profile) Count() int { + return 0 +} + func (p *Profile) WriteTo(w io.Writer, debug int) error { return ErrUnimplemented } + +func Profiles() []*Profile { + return nil +} diff --git a/src/runtime/trace/trace.go b/src/runtime/trace/trace.go new file mode 100644 index 0000000000..31cdbc33cb --- /dev/null +++ b/src/runtime/trace/trace.go @@ -0,0 +1,13 @@ +// Stubs for the runtime/trace package +package trace + +import ( + "errors" + "io" +) + +func Start(w io.Writer) error { + return errors.New("not implemented") +} + +func Stop() {}