Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201028153306-37f0764111ff / cmd / goimports / goimports_gc.go
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
5 // +build gc
6
7 package main
8
9 import (
10         "flag"
11         "runtime/trace"
12 )
13
14 var traceProfile = flag.String("trace", "", "trace profile output")
15
16 func doTrace() func() {
17         if *traceProfile != "" {
18                 bw, flush := bufferedFileWriter(*traceProfile)
19                 trace.Start(bw)
20                 return func() {
21                         flush()
22                         trace.Stop()
23                 }
24         }
25         return func() {}
26 }