Advertisement
kosx

Google CMD goimports_gc.go

Dec 30th, 2020
1,366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.49 KB | None | 0 0
  1. // Copyright 2016 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build gc
  5. package main
  6. import (
  7.     "flag"
  8.     "runtime/trace"
  9. )
  10. var traceProfile = flag.String("trace", "", "trace profile output")
  11. func doTrace() func() {
  12.     if *traceProfile != "" {
  13.         bw, flush := bufferedFileWriter(*traceProfile)
  14.         trace.Start(bw)
  15.         return func() {
  16.             flush()
  17.             trace.Stop()
  18.         }
  19.     }
  20.     return func() {}
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement