utility

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package utility is a package of collection of utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Utility

type Utility struct {
	FmtProxy     fmtproxy.Fmt
	OsProxy      osproxy.Os
	StrconvProxy strconvproxy.Strconv
}

Utility is a struct that implements UtilityInterface.

func New

func New(
	fmtProxy fmtproxy.Fmt,
	osProxy osproxy.Os,
	strconvProxy strconvproxy.Strconv,
) *Utility

New is a constructor for Utility.

func (*Utility) CreateDirIfNotExist

func (u *Utility) CreateDirIfNotExist(dirPath string) error

CreateDirIfNotExist creates a directory if it does not exist.

func (*Utility) GetLargerNumber

func (u *Utility) GetLargerNumber(num int, argNum string) int

GetLargerNumber gets the larger number between num and argNum.

func (*Utility) GetMaxConvertibleString

func (u *Utility) GetMaxConvertibleString(args []string, def string) string

GetMaxConvertibleString gets the maximum number from args and converts it to a string.

func (*Utility) PrintlnWithWriter

func (u *Utility) PrintlnWithWriter(writer ioproxy.WriterInstanceInterface, a ...any)

PrintlnWithWriter prints any with a writer.

type UtilityInterface

type UtilityInterface interface {
	PrintlnWithWriter(writer ioproxy.WriterInstanceInterface, a ...any)
	GetMaxConvertibleString(args []string, def string) string
	GetLargerNumber(num int, argNum string) int
	CreateDirIfNotExist(dirPath string) error
}

UtilityInterface is an interface for Utility.

Jump to

Keyboard shortcuts

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