OXIESEC PANEL
- Current Dir:
/
/
opt
/
golang
/
1.19.4
/
src
/
go
/
parser
/
testdata
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
12/01/2022 06:13:56 PM
rwxr-xr-x
📄
chans.go2
1.66 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
commas.src
365 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📄
interface.go2
1.08 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
issue11377.src
535 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📄
issue23434.src
546 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📄
issue3106.src
822 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📄
issue34946.src
601 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📁
issue42951
-
12/01/2022 06:13:56 PM
rwxr-xr-x
📄
issue44504.src
403 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📄
issue49174.go2
225 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📄
issue49175.go2
307 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📄
issue49482.go2
965 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📄
issue50427.go2
533 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📄
linalg.go2
2.03 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
map.go2
2.61 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
metrics.go2
908 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📁
resolution
-
12/01/2022 06:13:56 PM
rwxr-xr-x
📄
set.go2
474 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📄
slices.go2
666 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📄
sort.go2
902 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📄
tparams.go2
1.14 KB
12/01/2022 06:12:58 PM
rw-r--r--
📄
typeparams.src
516 bytes
12/01/2022 06:12:58 PM
rw-r--r--
📄
typeset.go2
1.97 KB
12/01/2022 06:12:58 PM
rw-r--r--
Editing: chans.go2
Close
package chans import "runtime" // Ranger returns a Sender and a Receiver. The Receiver provides a // Next method to retrieve values. The Sender provides a Send method // to send values and a Close method to stop sending values. The Next // method indicates when the Sender has been closed, and the Send // method indicates when the Receiver has been freed. // // This is a convenient way to exit a goroutine sending values when // the receiver stops reading them. func Ranger[T any]() (*Sender[T], *Receiver[T]) { c := make(chan T) d := make(chan bool) s := &Sender[T]{values: c, done: d} r := &Receiver[T]{values: c, done: d} runtime.SetFinalizer(r, r.finalize) return s, r } // A sender is used to send values to a Receiver. type Sender[T any] struct { values chan<- T done <-chan bool } // Send sends a value to the receiver. It returns whether any more // values may be sent; if it returns false the value was not sent. func (s *Sender[T]) Send(v T) bool { select { case s.values <- v: return true case <-s.done: return false } } // Close tells the receiver that no more values will arrive. // After Close is called, the Sender may no longer be used. func (s *Sender[T]) Close() { close(s.values) } // A Receiver receives values from a Sender. type Receiver[T any] struct { values <-chan T done chan<- bool } // Next returns the next value from the channel. The bool result // indicates whether the value is valid, or whether the Sender has // been closed and no more values will be received. func (r *Receiver[T]) Next() (T, bool) { v, ok := <-r.values return v, ok } // finalize is a finalizer for the receiver. func (r *Receiver[T]) finalize() { close(r.done) }