Converted code to a library & Improved command feedback
Pre-release
Pre-release
This release may break your code. If you were using an earlier version check your return types.
The wiki has not been updated to reflect the changes in this release
This release aims to achieve three goals:
-
Convert the code from a stand-alone go project to a library.
- Removed
main.goandfunc main() - Renamed the package of all files from
maintots3
- Removed
-
Improve logging
- Standardise the log format and colour
- Disable logging by default
- Provide a function to enable/disable logging
LoggingEnabled(true) - Ensure that we log when an error occurs with a basic message to indicate the cause of the issue
-
Standardise the response from functions within the lib
- The
Exec()function now returns three params*QueryResponse, body, error - Most functions will now check for errors and query failures after executing a statment for example
- The
res, body, error := client.Exec("serverlist")
if err != nil || !res.IsSucess {
// runtime error or query error occured
// log the issue
// return res, err
}- Made sure that the query response is returned to the function calling it where possible
- Used pointers for return types so that
nilcan be returned