util

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: MIT Imports: 10 Imported by: 28

README

util

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteToUtf8

func ByteToUtf8(iso8859_1_buf []byte) string

func DirCheckExists

func DirCheckExists(path string) (exists bool)

func DirMake

func DirMake(path string) error

func DirRemoveContents

func DirRemoveContents(dir string) error

func FileCheckExists

func FileCheckExists(name string) (exists bool)

func FileFindInTree

func FileFindInTree(name string) (filePath string, err error)

func IdRand

func IdRand(size int) (ID string)

func IdRand20

func IdRand20() (ID string)

func Round

func Round(args ...interface{}) float64

Arredonda um número de ponto flutuante para o inteiro mais próximo Round(valor, [em_torno], [dígitos_decimais]) float64 float64 valor float64 em torno = 0.5 float64 dígitos decimais

Example
fmt.Printf("%v\n", Round(1.22))
fmt.Printf("%v\n", Round(1.22, 0.2))
fmt.Printf("%v\n", Round(1.22, 0.5))
fmt.Printf("%v\n", Round(1.22, 0.7))
fmt.Printf("%v\n", Round(1.22, 0.5, 1.0))
fmt.Printf("%v\n", Round(1.33, 0.5, 1.0))
fmt.Printf("%v\n", Round(3.14159265358979323, 0.5, 8.0))
Output:

1
2
1
1
1.2
1.3
3.14159265

func SizeToString

func SizeToString(value int64) string

func StringRemoveSpellingAccents

func StringRemoveSpellingAccents(text string) string
Example
var text string = "áéíóúàèìòùâêîôûãẽĩõũäëïöüñçÁÉÍÓÚÀÈÌÒÙÂÊÎÔÛÃẼĨÕŨÄËÏÖÜÑÇ"

fmt.Print(StringRemoveSpellingAccents(text))
Output:

aeiouaeiouaeiouaeiouaeiouncAEIOUAEIOUAEIOUAEIOUAEIOUNC

func TraceToLog

func TraceToLog() (file string, line int, funcName string, ok bool)

TraceToLog (Português): Retorna os dados da função pai em caso de evento para ser colocado em log

file: caminho do arquivo
linha: linha do evento
funcName: nome da função onde o evento ocorreu

Types

This section is empty.

Jump to

Keyboard shortcuts

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