Discover Packages
github.com/LitFill/fatal
package
module
Version:
v0.0.1
Opens a new window with list of versions in this module.
Published: Jun 12, 2024
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
README
README
¶
fatal
fatal by LitFill .
library for fatal assignment or logging (error management)
Example
Log(http.ServeAndListen(port),
"Can not serve and listen",
"port", port
)
file := Assign(os.Create("log.txt"),
"Can not create file",
"file", "log.txt"
)
Expand ▾
Collapse ▴
Documentation
¶
fatal, LitFill <marrazzy54 at email dot com>
library for fatal assignment or logging (error management)
Assign wraps function call returning a `val` and error to log it
if error != nil using `log/slog` so it has `msg` and `log`.
example:
file := Assign(os.Create("log.txt"),
"Can not create file",
"file", "log.txt"
)
Log wraps function call returning error to log it using `log/slog` so it has `msg` and `log`.
example:
Log(http.ServeAndListen(port),
"Can not serve and listen",
"port", port
)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.