func (d *Deque) Inject(value interface{}) error {
	n := &node{}
	n.value = value
	d.tail.next = n
	n.prev = d.tail
	d.tail = n
	d.length++
	return nil
}
Inject adds an item at the end of deque
package deque
import (
	"fmt"
)
type node struct {
	value      interface{}
	prev, next *node
}
type Deque struct {
	head, tail *node
	length     uint
}
func New() *Deque {
	d := &Deque{}
	hn := &node{}
	d.head = hn
	d.tail = hn
	return d
}
func (d *Deque) Length() uint {
	return d.length
}
func (d *Deque) Push(value interface{}) error {
	n := &node{}
	n.value = value
	n.next = d.head.next
	n.prev = d.head
	d.head.next = n
	if d.length == 0 {
		d.tail = n
	}
	d.length++
	return nil
}
func (d *Deque) Pop() (interface{}, error) {
	if d.length == 0 {
		return nil, fmt.Errorf("Can not pop from an empty deque.")
	}
	item := d.head.next
	d.head.next = d.head.next.next
	if d.head.next != nil {
		d.head.next.prev = d.head
	}
	d.length--
	return item.value, nil
}