// Pop removes a Value from the front of the queue and returns it and true if
// queue is not empty, otherwise returns nil and false.
Pop removes a Value from the front of the queue and returns it and true if
queue is not empty, otherwise returns nil and false.
// Pop removes a Value from the front of the queue and returns it and true if // queue is not empty otherwise returns nil and false .
func (fifo *FIFO) Pop() (value interface{}, popped bool) {
	fifo.mu.Lock()
	defer fifo.mu.Unlock()
	if fifo.first == nil {
		return nil, false
	}
	value = fifo.first.Value
	popped = true
	fifo.first = fifo.first.next
	if fifo.first == nil {
		fifo.last = nil
	}
	fifo.length--
	return
}
func ( fifo * FIFO ) Pop ( ) ( value interface { } , popped bool ) { fifo . mu . Lock ( ) defer fifo . mu . Unlock ( ) if fifo . first == nil { return nil , false } value = fifo . first . Value popped = true fifo . first = fifo . first . next if fifo . first == nil { fifo . last = nil } fifo . length -- return }
Pop removes a Value from the front of the queue and returns it and true if
queue is not empty, otherwise returns nil and false.
Pop removes a Value from the front of the queue and returns it and true if queue is not empty otherwise returns nil and false .