goutils

package module
v0.0.0-...-68692b1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 10 Imported by: 0

README

Goutils - Data Handling Tool for Go

Data manipulation functions library for Go Language, inspired by native Python methods, to facilitate processes like:

  • Data type conversions.
  • Operations of numerical variables.
  • Handling of any type of data slices.
  • Input string handling.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes_To_Json

func Bytes_To_Json(byteValue []byte, json_data interface{})

func InSlice

func InSlice(e interface{}, s interface{}) bool

func Read_String

func Read_String(field_size int, prompt, border string) string

field_size : Max size of text (must be greater than 1). prompt : Text displayed before input. border : Delimiters of textbox (if not needed can be left like an empty string).

func Reverse_Slice

func Reverse_Slice(slice interface{})

func Slice_Index

func Slice_Index(e interface{}, s interface{}) int

func Slice_Pop

func Slice_Pop(slice interface{}, index int) bool

func Slice_Remove_Duplicate

func Slice_Remove_Duplicate(slice interface{})

func Sort_Slice

func Sort_Slice(s interface{})

To sort slices in ascending order 's' must be a pointer to a slice of int, float64, time or string Algorithm used: quick sort

func String_To_Date

func String_To_Date(date_str string) time.Time

func Swap_Slice

func Swap_Slice(index1 int, index2 int, slice interface{})

func To_Struct

func To_Struct(inter interface{}, struc interface{})

Types

type Bool

type Bool bool

func (Bool) To_Float64

func (b Bool) To_Float64() Float64

func (Bool) To_Int

func (b Bool) To_Int() Int

func (Bool) To_Int64

func (b Bool) To_Int64() Int64

func (Bool) To_String

func (b Bool) To_String() String

func (Bool) Value

func (b Bool) Value() bool

Bool converters

type Float64

type Float64 float64

func Random_Float64

func Random_Float64(inf, sup Float64) Float64

For random value

func (Float64) Abs

func (f Float64) Abs() Float64

For absolute value

func (Float64) Power

func (f Float64) Power(n float64) Float64

Power

func (Float64) Round

func (f Float64) Round(dec int) Float64

For rounding a number

func (Float64) To_Bool

func (f Float64) To_Bool() Bool

func (Float64) To_Int

func (f Float64) To_Int() Int

func (Float64) To_Int64

func (f Float64) To_Int64() Int64

func (Float64) To_String

func (f Float64) To_String() String

func (Float64) Value

func (f Float64) Value() float64

Float64 Converters

type Float64_Slice

type Float64_Slice []Float64

func (Float64_Slice) Max

func (f_slice Float64_Slice) Max() (Int, Float64)

Max Value

func (Float64_Slice) Min

func (f_slice Float64_Slice) Min() (Int, Float64)

Min Value

func (Float64_Slice) Sum

func (f_slice Float64_Slice) Sum() Float64

Summary

func (Float64_Slice) Value

func (f_slice Float64_Slice) Value() []float64

type Int

type Int int

func Map_Length

func Map_Length[M ~map[K]V, K comparable, V any](m M) Int

func Random_Int

func Random_Int(inf, sup Int) Int

func Slice_Length

func Slice_Length[S ~[]E, E any](s S) Int

func (Int) Abs

func (i Int) Abs() Int

func (Int) Power

func (i Int) Power(n float64) Int

func (Int) To_Bool

func (i Int) To_Bool() Bool

func (Int) To_Float64

func (i Int) To_Float64() Float64

func (Int) To_Int64

func (i Int) To_Int64() Int64

func (Int) To_String

func (i Int) To_String() String

func (Int) Value

func (i Int) Value() int

Int Converters

type Int64

type Int64 int64

func (Int64) Abs

func (i Int64) Abs() Int64

func (Int64) To_Bool

func (i Int64) To_Bool() Bool

func (Int64) To_Float64

func (i Int64) To_Float64() Float64

func (Int64) To_Int

func (i Int64) To_Int() Int

func (Int64) To_String

func (i Int64) To_String() String

func (Int64) Value

func (i Int64) Value() int64

Int64 Converters

type Int_Slice

type Int_Slice []Int

func (Int_Slice) Max

func (i_slice Int_Slice) Max() (Int, Int)

func (Int_Slice) Min

func (i_slice Int_Slice) Min() (Int, Int)

func (Int_Slice) Sum

func (i_slice Int_Slice) Sum() Int

func (Int_Slice) Value

func (i_slice Int_Slice) Value() []int

type String

type String string

func (String) Append

func (s String) Append(n_s string) String

func (String) Prepend

func (s String) Prepend(n_s string) String

Adding New String

func (String) To_Bool

func (s String) To_Bool() Bool

func (String) To_Float64

func (s String) To_Float64() Float64

func (String) To_Int

func (s String) To_Int() Int

func (String) To_Int64

func (s String) To_Int64() Int64

func (String) Value

func (s String) Value() string

String converters

type String_Slice

type String_Slice []String

func (String_Slice) Concatenate

func (s_slice String_Slice) Concatenate(sep string) String

Concatenate String Slice

func (String_Slice) Value

func (s_slice String_Slice) Value() []string

Jump to

Keyboard shortcuts

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