mirror of
https://github.com/emirpasic/gods.git
synced 2026-06-16 16:26:36 +03:00
Interface implementation assertions moved outside the functions
This commit is contained in:
@@ -16,9 +16,8 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func assertStackImplementation() {
|
||||
var _ stacks.Stack = (*Stack)(nil)
|
||||
}
|
||||
// Assert Stack implementation
|
||||
var _ stacks.Stack = (*Stack)(nil)
|
||||
|
||||
// Stack holds elements in an array-list
|
||||
type Stack struct {
|
||||
|
||||
@@ -6,9 +6,8 @@ package arraystack
|
||||
|
||||
import "github.com/emirpasic/gods/containers"
|
||||
|
||||
func assertIteratorImplementation() {
|
||||
var _ containers.ReverseIteratorWithIndex = (*Iterator)(nil)
|
||||
}
|
||||
// Assert Iterator implementation
|
||||
var _ containers.ReverseIteratorWithIndex = (*Iterator)(nil)
|
||||
|
||||
// Iterator returns a stateful iterator whose values can be fetched by an index.
|
||||
type Iterator struct {
|
||||
|
||||
@@ -8,10 +8,9 @@ import (
|
||||
"github.com/emirpasic/gods/containers"
|
||||
)
|
||||
|
||||
func assertSerializationImplementation() {
|
||||
var _ containers.JSONSerializer = (*Stack)(nil)
|
||||
var _ containers.JSONDeserializer = (*Stack)(nil)
|
||||
}
|
||||
// Assert Serialization implementation
|
||||
var _ containers.JSONSerializer = (*Stack)(nil)
|
||||
var _ containers.JSONDeserializer = (*Stack)(nil)
|
||||
|
||||
// ToJSON outputs the JSON representation of the stack.
|
||||
func (stack *Stack) ToJSON() ([]byte, error) {
|
||||
|
||||
Reference in New Issue
Block a user