File: doc.go

package info (click to toggle)
golang-github-juju-utils 0.0~git20171220.f38c0b0-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,748 kB
  • sloc: makefile: 20
file content (23 lines) | stat: -rw-r--r-- 763 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
23
// Copyright 2015 Canonical Ltd.
// Licensed under the LGPLv3, see LICENCE file for details.

// The deque package 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