()
| 91 | } |
| 92 | |
| 93 | func (f *Flags) cleanup() { |
| 94 | if f.cpuProfileFile != nil { |
| 95 | pprof.StopCPUProfile() |
| 96 | f.cpuProfileFile.Close() |
| 97 | } |
| 98 | if f.memprofile != "" { |
| 99 | runMemProfile(f.memprofile) |
| 100 | } |
| 101 | if f.traceFile != nil { |
| 102 | trace.Stop() |
| 103 | f.traceFile.Close() |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | func (f *Flags) runCPUProfile(path string) { |
| 108 | file, err := os.Create(path) |
no test coverage detected