Help us shape the future of Go! Take the 2026 Go Developer Survey

utils

package
v1.7.11 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseLogErrZap added in v1.7.8

func CloseLogErrZap(closer io.Closer, logger *zap.Logger)

func DistinctStringSlice

func DistinctStringSlice(s []string) []string

func Dos2UnixWriter

func Dos2UnixWriter(w io.Writer) io.WriteCloser

func InStringSlice

func InStringSlice(slice []string, s string) bool

func IsDir

func IsDir(path string) bool

func IsFile

func IsFile(path string) bool

func IsPathExist

func IsPathExist(path string) bool

func JoinStringAny

func JoinStringAny(sep string, a ...fmt.Stringer) string

func MaxInt

func MaxInt(a, b int) int

func MinInt

func MinInt(a, b int) int

func ReadFileLimited

func ReadFileLimited(p string, maxRead int64) ([]byte, error)

func Unix2DosWriter

func Unix2DosWriter(w io.Writer) io.WriteCloser

Types

type StringSet

type StringSet map[string]struct{}

func NewStringSet

func NewStringSet() StringSet

func (StringSet) Contains

func (s StringSet) Contains(t string) bool

func (StringSet) Put

func (s StringSet) Put(t string) StringSet

func (StringSet) ToSlice

func (s StringSet) ToSlice() []string

type SuffixBuffer

type SuffixBuffer struct {
	// contains filtered or unexported fields
}

func MkSuffixBuffer added in v1.7.11

func MkSuffixBuffer(capacity int) *SuffixBuffer

func (*SuffixBuffer) Bytes

func (r *SuffixBuffer) Bytes() (rs []byte)

func (*SuffixBuffer) Write

func (r *SuffixBuffer) Write(data []byte) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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