Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments in fatal library changed to adhere to Go documentation style #2249

Merged
merged 1 commit into from
Dec 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions go/lib/fatal/fatal.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ var (
fatalC chan struct{}
)

// Initialize the package.
// Init Initializes the package.
// This MUST be called in the main coroutine when it starts.
func Init() {
fatalC = make(chan struct{})
}

// Check whether the package was initialized.
// Check checks whether the package was initialized.
// This MUST be called when a library producing fatal errors starts is initialized.
func Check() {
if fatalC == nil {
Expand All @@ -48,7 +48,7 @@ func Check() {
}
}

// Produce a fatal error. This function never exits.
// Fatal produces a fatal error. This function never exits.
func Fatal(err error) {
log.Crit("Fatal error", "err", err)
// Grace period to gather more logs in case that
Expand All @@ -65,7 +65,8 @@ func Fatal(err error) {
}
}

// Get access to the underlying channel. This is used by main goroutine to wait for fatal errors.
// Chan returns a read-only channel to be used by the main goroutine to get notified
// about fatal conditions.
func Chan() <-chan struct{} {
return fatalC
}