1
0
mirror of https://github.com/golang/go synced 2024-10-01 03:18:33 -06:00
go/internal/lsp/analysis/simplifycompositelit
Rohan Challa e428a8eca3 internal/lsp/analysis: add simplify-composite-lit pass from "gofmt -s"
This is one of the simplifications that "gofmt -s" applies.
https://golang.org/cmd/gofmt/#hdr-The_simplify_command

An array, slice, or map composite literal of the form:
	[]T{T{}, T{}}
will be simplified to:
	[]T{{}, {}}

Updates golang/go#37221

Change-Id: I2dca46501983c8af3581c9319d973da5cf690388
Reviewed-on: https://go-review.googlesource.com/c/tools/+/223660
Run-TryBot: Rohan Challa <rohan@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
2020-03-26 20:50:12 +00:00
..
testdata/src/a internal/lsp/analysis: add simplify-composite-lit pass from "gofmt -s" 2020-03-26 20:50:12 +00:00
simplifycompositelit_test.go internal/lsp/analysis: add simplify-composite-lit pass from "gofmt -s" 2020-03-26 20:50:12 +00:00
simplifycompositelit.go internal/lsp/analysis: add simplify-composite-lit pass from "gofmt -s" 2020-03-26 20:50:12 +00:00