MCPcopy Create free account
hub / github.com/blindlobstar/go-interview-problems / Push

Method Push

10-concurrent-queue/solution/solution.go:15–22  ·  view source on GitHub ↗
(val int)

Source from the content-addressed store, hash-verified

13}
14
15func (q *Queue) Push(val int) error {
16 select {
17 case q.ch <- val:
18 return nil
19 default:
20 return ErrQueueFull
21 }
22}
23
24func (q *Queue) Pop() int {
25 select {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected