diff --git a/README.md b/README.md index 9788929..fad742a 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ -Unit test count +Unit test count @@ -73,20 +73,21 @@ Package stack is a simple implemntation of a stack data structure. It uses gener ## Index -- [type Stack](<#type-stack>) - - [func New[T any]() Stack[T]](<#func-new>) - - [func (s *Stack[T]) Clear()](<#func-stackt-clear>) - - [func (s *Stack[T]) Contains(item T) bool](<#func-stackt-contains>) - - [func (s *Stack[T]) IsEmpty() bool](<#func-stackt-isempty>) - - [func (s *Stack[T]) Peek() T](<#func-stackt-peek>) - - [func (s *Stack[T]) Pop() T](<#func-stackt-pop>) - - [func (s *Stack[T]) PopSafe() T](<#func-stackt-popsafe>) - - [func (s *Stack[T]) Push(item ...T)](<#func-stackt-push>) - - [func (s *Stack[T]) Size() int](<#func-stackt-size>) - - [func (s Stack[T]) String() string](<#func-stackt-string>) - - [func (s *Stack[T]) Values() []T](<#func-stackt-values>) - - +- [type Stack](<#Stack>) + - [func New\[T any\]\(\) Stack\[T\]](<#New>) + - [func \(s \*Stack\[T\]\) Clear\(\)](<#Stack[T].Clear>) + - [func \(s \*Stack\[T\]\) Contains\(item T\) bool](<#Stack[T].Contains>) + - [func \(s \*Stack\[T\]\) IsEmpty\(\) bool](<#Stack[T].IsEmpty>) + - [func \(s \*Stack\[T\]\) Peek\(\) T](<#Stack[T].Peek>) + - [func \(s \*Stack\[T\]\) Pop\(\) T](<#Stack[T].Pop>) + - [func \(s \*Stack\[T\]\) PopSafe\(\) T](<#Stack[T].PopSafe>) + - [func \(s \*Stack\[T\]\) Push\(item ...T\)](<#Stack[T].Push>) + - [func \(s \*Stack\[T\]\) Size\(\) int](<#Stack[T].Size>) + - [func \(s Stack\[T\]\) String\(\) string](<#Stack[T].String>) + - [func \(s \*Stack\[T\]\) Values\(\) \[\]T](<#Stack[T].Values>) + + + ## type [Stack]() Stack is a simple implementation of a stack data structure. @@ -97,6 +98,7 @@ type Stack[T any] struct { } ``` + ### func [New]() ```go @@ -108,6 +110,8 @@ New returns a new stack.
Example

+ + ```go package main @@ -123,6 +127,7 @@ func main() {

+ ### func \(\*Stack\[T\]\) [Clear]() ```go @@ -134,6 +139,8 @@ Clear removes all items from the stack.
Example

+ + ```go package main @@ -164,6 +171,7 @@ func main() {

+ ### func \(\*Stack\[T\]\) [Contains]() ```go @@ -175,6 +183,8 @@ Contains returns true if the stack contains the item.
Example

+ + ```go package main @@ -205,6 +215,7 @@ false

+ ### func \(\*Stack\[T\]\) [IsEmpty]() ```go @@ -216,6 +227,8 @@ IsEmpty returns true if the stack is empty.
Example

+ + ```go package main @@ -249,6 +262,7 @@ true

+ ### func \(\*Stack\[T\]\) [Peek]() ```go @@ -257,6 +271,7 @@ func (s *Stack[T]) Peek() T Peek returns the top item of the stack without removing it. + ### func \(\*Stack\[T\]\) [Pop]() ```go @@ -268,6 +283,8 @@ Pop removes an item from the stack and returns it. Panics if the stack is empty.
Example

+ + ```go package main @@ -298,6 +315,7 @@ Hello

+ ### func \(\*Stack\[T\]\) [PopSafe]() ```go @@ -309,6 +327,8 @@ PopSafe removes an item from the stack and returns it. Returns the zero value of
Example

+ + ```go package main @@ -340,6 +360,7 @@ Hello

+ ### func \(\*Stack\[T\]\) [Push]() ```go @@ -351,6 +372,8 @@ Push adds items to a stack.
Example

+ + ```go package main @@ -379,6 +402,7 @@ func main() {

+ ### func \(\*Stack\[T\]\) [Size]() ```go @@ -390,6 +414,8 @@ Size returns the size of the stack.
Example

+ + ```go package main @@ -418,15 +444,20 @@ func main() {

+ ### func \(Stack\[T\]\) [String]() ```go func (s Stack[T]) String() string ``` + +
Example

+ + ```go package main @@ -455,6 +486,7 @@ func main() {

+ ### func \(\*Stack\[T\]\) [Values]() ```go @@ -466,6 +498,8 @@ Values returns the values of the stack as a slice.
Example

+ + ```go package main @@ -494,8 +528,6 @@ func main() {

- - Generated by [gomarkdoc]()