diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2019-12-10 16:21:56 +0100 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2019-12-10 21:31:00 +0000 |
commit | 84540f0b0acb4bb4c488b138345197c3e537d837 (patch) | |
tree | dc9d87bc92a227bd84bf3abbb6c84d14a8dd16c8 | |
parent | 207a0b79336a470810b4ffcd72756240097cf93d (diff) | |
download | go-84540f0b0acb4bb4c488b138345197c3e537d837.tar.gz go-84540f0b0acb4bb4c488b138345197c3e537d837.zip |
cmd/compile/internal/logopt: gofmt
Change-Id: Ie9d29645e7702104202ee1f338babdd9e33e1e58
Reviewed-on: https://go-review.googlesource.com/c/go/+/210679
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-rw-r--r-- | src/cmd/compile/internal/logopt/log_opts.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/cmd/compile/internal/logopt/log_opts.go b/src/cmd/compile/internal/logopt/log_opts.go index 4064054593..2639d27105 100644 --- a/src/cmd/compile/internal/logopt/log_opts.go +++ b/src/cmd/compile/internal/logopt/log_opts.go @@ -321,12 +321,14 @@ func Enabled() bool { // byPos sorts diagnostics by source position. type byPos struct { ctxt *obj.Link - a []LoggedOpt + a []LoggedOpt } -func (x byPos) Len() int { return len(x.a) } -func (x byPos) Less(i, j int) bool { return x.ctxt.OutermostPos(x.a[i].pos).Before(x.ctxt.OutermostPos(x.a[j].pos)) } -func (x byPos) Swap(i, j int) { x.a[i], x.a[j] = x.a[j], x.a[i] } +func (x byPos) Len() int { return len(x.a) } +func (x byPos) Less(i, j int) bool { + return x.ctxt.OutermostPos(x.a[i].pos).Before(x.ctxt.OutermostPos(x.a[j].pos)) +} +func (x byPos) Swap(i, j int) { x.a[i], x.a[j] = x.a[j], x.a[i] } func writerForLSP(subdirpath, file string) io.WriteCloser { basename := file @@ -367,7 +369,7 @@ func uriIfy(f string) DocumentURI { // Return filename, replacing a first occurrence of $GOROOT with the // actual value of the GOROOT (because LSP does not speak "$GOROOT"). func uprootedPath(filename string) string { - if ! strings.HasPrefix(filename, "$GOROOT/") { + if !strings.HasPrefix(filename, "$GOROOT/") { return filename } return objabi.GOROOT + filename[len("$GOROOT"):] @@ -379,7 +381,7 @@ func FlushLoggedOpts(ctxt *obj.Link, slashPkgPath string) { return } - sort.Stable(byPos{ctxt,loggedOpts}) // Stable is necessary to preserve the per-function order, which is repeatable. + sort.Stable(byPos{ctxt, loggedOpts}) // Stable is necessary to preserve the per-function order, which is repeatable. switch Format { case Json0: // LSP 3.15 |