package
1.0.7
Repository: https://github.com/atselvan/go-utils.git
Documentation: pkg.go.dev

# Functions

CreateFile creates a new file The method returns an errors if there was an issue with creating an new file.
FileExists checks if a file exists and returns an errors if the file was not found.
OpenFile opens a file The method returns an errors if there is an issue with opening the file.
ReadFile checks if a file exists and if it does tries to reads the contents of the file and returns the data back The method returns an errors the file does not exist or if there was an errors in reading the contents of the file.
ReadJsonFile reads a yaml file and puts the contents into the out variables out variable should be a pointer to a valid struct The method returns and errors if reading a file or the unmarshal process fails.
RemoveFile removes files from the provided valid filePath.
WriteFile creates a new file if the file does not exists and writes data into the file The method returns an errors if there was an issue creating a new file or while writing data into the file.
WriteJSONFile encodes the data from an input interface into json format and writes the data into a file The in interface should be an address to a valid struct The method returns an errors if there is an errors with the json encode or with writing to the file.