Skip to content

Commit

Permalink
Comments in fatal library changed to adhere to Go documentation style (
Browse files Browse the repository at this point in the history
  • Loading branch information
sustrik authored Dec 14, 2018
1 parent 45d8974 commit e938d39
Showing 1 changed file with 5 additions and 4 deletions.
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
}

0 comments on commit e938d39

Please sign in to comment.