util

package
v0.0.0-...-780cc0d Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array[T comparable] struct{}

func (Array[T]) Exist

func (a Array[T]) Exist(array []T, val T) (index int)

Exist 数组中是否存在某值,返回下标

func (Array[T]) Unique

func (a Array[T]) Unique(array ...T) []T

Unique 数组去重

type IArray

type IArray[T comparable] interface {
	Exist(array T, val T) (index int)
	Unique(array ...T) []T
}

type SyncChan

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

func NewSyncChanUtil

func NewSyncChanUtil(count int32) *SyncChan

NewSyncChanUtil 多线程控制,限制线程数量

func (SyncChan) Add

func (s SyncChan) Add()

Add 实现多线程运行,且限制线程数量为num

func (SyncChan) Done

func (s SyncChan) Done()

Done 线程运行结束是需要执行结束

func (SyncChan) Wait

func (s SyncChan) Wait()

Wait 等待线程执行

Jump to

Keyboard shortcuts

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