utils

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package utils diff implements a Diff function that compare two inputs using the 'diff' tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(prefix string, b1, b2 []byte) ([]byte, error)

Diff returns diff of two arrays of bytes in diff tool format.

func SortDeDup

func SortDeDup(l []string) []string

Types

type Stack

type Stack []interface{}

func NewStack

func NewStack(capacity int) *Stack

NewStack returns a new Stack.

func (*Stack) Copy

func (s *Stack) Copy(start, end int) *Stack

func (*Stack) Get

func (s *Stack) Get(idx int) (interface{}, bool)

Get read the value at idx from Stack without modifying the Stack. Return nil, false if idx out of range.

func (*Stack) Len

func (s *Stack) Len() int

Len returns the length of Stack.

func (*Stack) Pop

func (s *Stack) Pop() (interface{}, bool)

Pop removes and return top element of Stack. Return nil, false if Stack is empty.

func (*Stack) Push

func (s *Stack) Push(node interface{})

Push a new value onto the Stack.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL