utils

package
v0.0.0-...-edc77cd Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtArrayPosition

func AtArrayPosition(value interface{}, array interface{}) (index int)

AtArrayPosition finds the position(int) of value in an Array(Slice)

func CreateFileNotExist

func CreateFileNotExist(filePath string) error

CreateFileNotExist creates file if not exist

func ExecuteCommand

func ExecuteCommand(cmd string) ([]interface{}, error)

ExecuteCommand executes command and return results

func FilePathExist

func FilePathExist(filePath string) bool

FilePathExist returns true if file is exist, else false

func InArray

func InArray(value interface{}, array interface{}) bool

InArray checks is value exists in an Array (Slice)

func InSlice

func InSlice[T comparable](values []T, value T) bool

InSlice checks if an element in a slice

func IndexOf

func IndexOf[T comparable](values []T, value T) int

IndexOf returns an elements position in a slice Return -1 if element not found in slice

func IsCommandExist

func IsCommandExist(cmd string) bool

IsCommandExist returns true if `cmd` is exist in OS

func IsNil

func IsNil(i interface{}) bool

IsNil checks a variable is nil

func JoinPath

func JoinPath(baseUrl string, elem ...string) (result string, err error)

JoinPath concatenates baseUrl and the elements - check baseUrl format - concatenates baseUrl and the elements

Types

This section is empty.

Jump to

Keyboard shortcuts

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