util

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseButLogError

func CloseButLogError(closer io.Closer, callContext string)

CloseButLogError closes IO closables and logs an error

func Contains

func Contains(slice []string, item string) bool

Contains checks if item is in the slice

func Exists

func Exists(path string) bool

Exists returns true if the path exists

func GetContentOfFile

func GetContentOfFile(path string) (string, error)

GetContentOfFile all content of the file at the given path and returns it as string

func ReadJSONFile

func ReadJSONFile(structure interface{}, path string) error

ReadJSONFile reads a json file from the given path and mappes the fields to the given struct

func Reverse

func Reverse(s string) (result string)

Reverse returns a reversed string.

func WriteJSONFile

func WriteJSONFile(structure interface{}, path string) error

WriteJSONFile writes a structure to a json file

func WriteJSONFileIndented

func WriteJSONFileIndented(structure interface{}, path string) error

WriteJSONFileIndented writes a structure indented to a json file

Types

This section is empty.

Jump to

Keyboard shortcuts

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