File: doc.go

package info (click to toggle)
golang-github-juju-collections 1.0.4-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie, trixie-proposed-updates
  • size: 176 kB
  • sloc: makefile: 18
file content (22 lines) | stat: -rw-r--r-- 723 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright 2015 Canonical Ltd.
// Licensed under the LGPLv3, see LICENCE file for details.

// Package deque implements an efficient double-ended queue data
// structure called Deque.
//
// Usage:
//
//	d := deque.New()
//	d.PushFront("foo")
//	d.PushBack("bar")
//	d.PushBack("123")
//	l := d.Len()          // l == 3
//	v, ok := d.PopFront() // v.(string) == "foo", ok == true
//	v, ok = d.PopFront()  // v.(string) == "bar", ok == true
//	v, ok = d.PopBack()   // v.(string) == "123", ok == true
//	v, ok = d.PopBack()   // v == nil, ok == false
//	v, ok = d.PopFront()  // v == nil, ok == false
//	l = d.Len()           // l == 0
//
// A discussion of the internals can be found at the top of deque.go.
package deque