xslice

package
v0.21.4 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2019 License: Apache-2.0 Imports: 3 Imported by: 16

README

GoKit - xslice

Slice kits for Golang development.

Installation

go get -u github.com/likexian/gokit

Importing

import (
    "github.com/likexian/gokit/xslice"
)

Documentation

Visit the docs on GoDoc

Example

Get unique of string array
array := xslice.Unique([]string{"a", "a", "b", "b", "b", "c"})
fmt.Println("new array:", array)
Get unique of int array
array := xslice.Unique([]int{0, 0, 1, 1, 1, 2, 2, 3})
fmt.Println("new array:", array)

LICENSE

Copyright 2012-2019 Li Kexian

Licensed under the Apache License 2.0

About

DONATE

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Author

func Author() string

Author returns package author

func Different added in v0.21.4

func Different(x, y interface{}) interface{}

Different returns difference of two slices

func Intersect added in v0.21.4

func Intersect(x, y interface{}) interface{}

Intersect returns intersection of two slices

func IsUnique added in v0.21.3

func IsUnique(v interface{}) bool

IsUnique returns whether slice is unique

func License

func License() string

License returns package license

func Merge added in v0.21.4

func Merge(x, y interface{}) interface{}

Merge returns merged of two slices

func Unique

func Unique(v interface{}) interface{}

Unique returns an unique slice

func UniqueAppend added in v0.21.3

func UniqueAppend(v interface{}, x interface{}) interface{}

UniqueAppend append to slice if not exists

func Version

func Version() string

Version returns package version

Types

This section is empty.

Jump to

Keyboard shortcuts

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