X7ROOT File Manager
Current Path:
/opt/golang/1.19.4/src/cmd/gofmt/testdata
opt
/
golang
/
1.19.4
/
src
/
cmd
/
gofmt
/
testdata
/
📁
..
📄
comments.golden
(76 B)
📄
comments.input
(76 B)
📄
composites.golden
(2.54 KB)
📄
composites.input
(3.16 KB)
📄
crlf.golden
(230 B)
📄
crlf.input
(243 B)
📄
emptydecl.golden
(140 B)
📄
emptydecl.input
(148 B)
📄
go2numbers.golden
(1.9 KB)
📄
go2numbers.input
(1.96 KB)
📄
import.golden
(2.1 KB)
📄
import.input
(2.1 KB)
📄
issue28082.golden
(249 B)
📄
issue28082.input
(447 B)
📄
ranges.golden
(307 B)
📄
ranges.input
(304 B)
📄
rewrite1.golden
(248 B)
📄
rewrite1.input
(248 B)
📄
rewrite10.golden
(350 B)
📄
rewrite10.input
(350 B)
📄
rewrite2.golden
(407 B)
📄
rewrite2.input
(406 B)
📄
rewrite3.golden
(422 B)
📄
rewrite3.input
(422 B)
📄
rewrite4.golden
(1.04 KB)
📄
rewrite4.input
(1.12 KB)
📄
rewrite5.golden
(446 B)
📄
rewrite5.input
(538 B)
📄
rewrite6.golden
(463 B)
📄
rewrite6.input
(463 B)
📄
rewrite7.golden
(466 B)
📄
rewrite7.input
(472 B)
📄
rewrite8.golden
(292 B)
📄
rewrite8.input
(300 B)
📄
rewrite9.golden
(228 B)
📄
rewrite9.input
(238 B)
📄
slices1.golden
(927 B)
📄
slices1.input
(957 B)
📄
stdin1.golden
(32 B)
📄
stdin1.input
(32 B)
📄
stdin2.golden
(101 B)
📄
stdin2.input
(101 B)
📄
stdin3.golden
(101 B)
📄
stdin3.input
(96 B)
📄
stdin4.golden
(38 B)
📄
stdin4.input
(39 B)
📄
stdin5.golden
(55 B)
📄
stdin5.input
(54 B)
📄
stdin6.golden
(199 B)
📄
stdin6.input
(217 B)
📄
stdin7.golden
(342 B)
📄
stdin7.input
(296 B)
📄
tabs.golden
(480 B)
📄
tabs.input
(449 B)
📄
typealias.golden
(365 B)
📄
typealias.input
(360 B)
📄
typeparams.golden
(680 B)
📄
typeparams.input
(677 B)
📄
typeswitch.golden
(1.43 KB)
📄
typeswitch.input
(1.43 KB)
Editing: typeswitch.input
/* Parenthesized type switch expressions originally accepted by gofmt must continue to be rewritten into the correct unparenthesized form. Only type-switches that didn't declare a variable in the type switch type assertion and which contained only "expression-like" (named) types in their cases were permitted to have their type assertion parenthesized by go/parser (due to a weak predicate in the parser). All others were rejected always, either with a syntax error in the type switch header or in the case. See also issue 4470. */ package p func f() { var x interface{} switch x.(type) { // should remain the same } switch (x.(type)) { // should become: switch x.(type) { } switch x.(type) { // should remain the same case int: } switch (x.(type)) { // should become: switch x.(type) { case int: } switch x.(type) { // should remain the same case []int: } // Parenthesized (x.(type)) in type switches containing cases // with unnamed (literal) types were never permitted by gofmt; // thus there won't be any code in the wild using this style if // the code was gofmt-ed. /* switch (x.(type)) { case []int: } */ switch t := x.(type) { // should remain the same default: _ = t } // Parenthesized (x.(type)) in type switches declaring a variable // were never permitted by gofmt; thus there won't be any code in // the wild using this style if the code was gofmt-ed. /* switch t := (x.(type)) { default: _ = t } */ }
Upload File
Create Folder