mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
vendor: add golang-collections
This commit is contained in:
parent
897d47d0cc
commit
c2ea933059
3 changed files with 66 additions and 0 deletions
20
vendor/github.com/golang-collections/collections/LICENSE
generated
vendored
Normal file
20
vendor/github.com/golang-collections/collections/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
Copyright (c) 2012 Caleb Doxsey
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
44
vendor/github.com/golang-collections/collections/stack/stack.go
generated
vendored
Normal file
44
vendor/github.com/golang-collections/collections/stack/stack.go
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
package stack
|
||||||
|
|
||||||
|
type (
|
||||||
|
Stack struct {
|
||||||
|
top *node
|
||||||
|
length int
|
||||||
|
}
|
||||||
|
node struct {
|
||||||
|
value interface{}
|
||||||
|
prev *node
|
||||||
|
}
|
||||||
|
)
|
||||||
|
// Create a new stack
|
||||||
|
func New() *Stack {
|
||||||
|
return &Stack{nil,0}
|
||||||
|
}
|
||||||
|
// Return the number of items in the stack
|
||||||
|
func (this *Stack) Len() int {
|
||||||
|
return this.length
|
||||||
|
}
|
||||||
|
// View the top item on the stack
|
||||||
|
func (this *Stack) Peek() interface{} {
|
||||||
|
if this.length == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return this.top.value
|
||||||
|
}
|
||||||
|
// Pop the top item of the stack and return it
|
||||||
|
func (this *Stack) Pop() interface{} {
|
||||||
|
if this.length == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
n := this.top
|
||||||
|
this.top = n.prev
|
||||||
|
this.length--
|
||||||
|
return n.value
|
||||||
|
}
|
||||||
|
// Push a value onto the top of the stack
|
||||||
|
func (this *Stack) Push(value interface{}) {
|
||||||
|
n := &node{value,this.top}
|
||||||
|
this.top = n
|
||||||
|
this.length++
|
||||||
|
}
|
||||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
|
|
@ -42,6 +42,8 @@ github.com/fatih/color
|
||||||
github.com/go-errors/errors
|
github.com/go-errors/errors
|
||||||
# github.com/gogo/protobuf v1.2.1
|
# github.com/gogo/protobuf v1.2.1
|
||||||
github.com/gogo/protobuf/proto
|
github.com/gogo/protobuf/proto
|
||||||
|
# github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3
|
||||||
|
github.com/golang-collections/collections/stack
|
||||||
# github.com/imdario/mergo v0.3.7
|
# github.com/imdario/mergo v0.3.7
|
||||||
github.com/imdario/mergo
|
github.com/imdario/mergo
|
||||||
# github.com/integrii/flaggy v0.0.0-20190517180110-07ea7eb77404
|
# github.com/integrii/flaggy v0.0.0-20190517180110-07ea7eb77404
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue