utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BreakSignal

func BreakSignal() (sc chan os.Signal)

Listen Kill,Term,Interupt to Channel

func ConvBtoI

func ConvBtoI(b []byte) int

Byte を intに

func PrintError

func PrintError(message string, err error) (errored bool)

Error表示

func Rand

func Rand(max int) (result int)

Rand Generate 0~max-1

func RegMatch

func RegMatch(text string, check string) (match bool)

Regexp Match

func RegReplace

func RegReplace(fromText string, toText string, check string) (replaced string)

Regexp Replace

func ResetPrintBackColor

func ResetPrintBackColor()

背景の色を元に戻す

func ResetPrintWordColor

func ResetPrintWordColor()

文字の色を元に戻す

func SetPrintBackColor

func SetPrintBackColor(r int, g int, b int)

背景の色を変える

func SetPrintWordColor

func SetPrintWordColor(r int, g int, b int)

文字の色を変える

func StdPipe

func StdPipe(io *exec.Cmd) (inIo io.WriteCloser, outIo io.ReadCloser, errIo io.ReadCloser)

IOを分けて返却

func StrCut

func StrCut(text, suffix string, max int) (result string)

String Cut

Types

type ExMap

type ExMap struct {
	Sm sync.Map
}

func NewExMap

func NewExMap() *ExMap

排他的Mapを入手 排他的MAPの型 : sync.Map

func (*ExMap) Check

func (m *ExMap) Check(key string) (ok bool)

排他的Mapに存在するか確認

func (*ExMap) Delete

func (m *ExMap) Delete(key string)

排他的Mapの削除

func (*ExMap) Load

func (m *ExMap) Load(key string) (value any, ok bool)

排他的Mapを読み込み value.(型名)での変換が必要

func (*ExMap) Write

func (m *ExMap) Write(key string, value any)

排他的Mapに書き込み

Jump to

Keyboard shortcuts

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