X7ROOT File Manager
Current Path:
/opt/golang/1.17.2/test/typeparam
opt
/
golang
/
1.17.2
/
test
/
typeparam
/
📁
..
📄
absdiff.go
(2.71 KB)
📄
adder.go
(580 B)
📄
append.go
(615 B)
📄
chans.go
(8.46 KB)
📄
combine.go
(1.56 KB)
📄
cons.go
(2 KB)
📄
double.go
(1.61 KB)
📄
fact.go
(644 B)
📄
graph.go
(5.73 KB)
📄
importtest.go
(322 B)
📄
index.go
(941 B)
📄
interfacearg.go
(723 B)
📄
issue45547.go
(476 B)
📄
issue45722.go
(576 B)
📄
issue45738.go
(295 B)
📄
list.go
(2.56 KB)
📄
list2.go
(15.11 KB)
📄
lockable.go
(935 B)
📄
map.go
(899 B)
📄
maps.go
(5.93 KB)
📄
metrics.go
(4.46 KB)
📄
min.go
(757 B)
📄
ordered.go
(2.21 KB)
📄
orderedmap.go
(7.13 KB)
📄
pair.go
(748 B)
📄
pragma.go
(416 B)
📄
sets.go
(5.71 KB)
📄
settable.go
(2.77 KB)
📄
slices.go
(8.13 KB)
📄
smallest.go
(817 B)
📄
smoketest.go
(996 B)
📄
stringable.go
(863 B)
📄
stringer.go
(1.57 KB)
📄
struct.go
(862 B)
📄
sum.go
(945 B)
📄
tparam1.go
(1.04 KB)
📄
typelist.go
(2.99 KB)
📄
value.go
(1.47 KB)
Editing: append.go
// run -gcflags=-G=3 // Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main type Recv <-chan int type sliceOf[E any] interface { type []E } func _Append[S sliceOf[T], T any](s S, t ...T) S { return append(s, t...) } func main() { recv := make(Recv) a := _Append([]Recv{recv}, recv) if len(a) != 2 || a[0] != recv || a[1] != recv { panic(a) } recv2 := make(chan<- int) a2 := _Append([]chan<- int{recv2}, recv2) if len(a2) != 2 || a2[0] != recv2 || a2[1] != recv2 { panic(a) } }
Upload File
Create Folder