(ctx context.Context)
| 79 | } |
| 80 | |
| 81 | func (p *pprofServer) Shutdown(ctx context.Context) error { |
| 82 | if p == nil { |
| 83 | return nil |
| 84 | } |
| 85 | p.mu.Lock() |
| 86 | currentServer := p.server |
| 87 | currentAddr := p.addr |
| 88 | p.server = nil |
| 89 | p.enabled = false |
| 90 | p.mu.Unlock() |
| 91 | |
| 92 | if currentServer == nil { |
| 93 | return nil |
| 94 | } |
| 95 | return p.stopServerWithContext(ctx, currentServer, currentAddr, "shutdown") |
| 96 | } |
| 97 | |
| 98 | func (p *pprofServer) startServer(addr string) { |
| 99 | mux := newPprofMux() |
nothing calls this directly
no test coverage detected