Skip to content

Commit 9d60bbb

Browse files
committed
Fix some grammar
Signed-off-by: Alexander Morozov <[email protected]>
1 parent 9849cf6 commit 9d60bbb

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lock.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"github.com/Sirupsen/logrus"
1010
)
1111

12-
// Mutex is debug mutex, which prints logs and traces for locks
13-
// implements sync.Locker interface
12+
// Mutex is debugging mutex, which prints logs and traces for locks.
13+
// Mutex implements sync.Locker interface.
1414
type Mutex struct {
1515
retries int
1616
mu sync.Mutex
@@ -19,10 +19,10 @@ type Mutex struct {
1919
errFunc func(format string, args ...interface{})
2020
}
2121

22-
// New returns new debug mutex
23-
// retries parameter specify number of retries acquiring Mutex before error
24-
// message, if <=0, then wait forever
25-
// if fatal is true, then program will exit by os.Exit(1)
22+
// New returns new debug mutex.
23+
// retries specify the number of retries acquiring Mutex before error
24+
// message, if <=0, then retry forever.
25+
// If fatal is true, then program will exit by os.Exit(1).
2626
func New(retries int, fatal bool) sync.Locker {
2727
var errF func(format string, args ...interface{})
2828
errF = logrus.Errorf
@@ -36,8 +36,8 @@ func New(retries int, fatal bool) sync.Locker {
3636
}
3737

3838
// Lock tries to lock mutex. Interval between attempts is 1 second.
39-
// On each attempt stack trace and file:lino of previous Lock will be printed.
40-
// Lock does os.Exit(1) after last attempt.
39+
// On each attempt stack trace and file:line of a previous Lock printed.
40+
// Lock does os.Exit(1) after last attempt if fatal parameter was true.
4141
func (m *Mutex) Lock() {
4242
_, file, line, _ := runtime.Caller(1)
4343
caller := fmt.Sprintf("%s:%d", file, line)
@@ -71,8 +71,8 @@ loop:
7171
m.myMu.Unlock()
7272
}
7373

74-
// Unlock unlocks mutex. It prints place in code where it was called and where
75-
// mutex was locked.
74+
// Unlock unlocks the mutex. It prints place in the code where it was called
75+
// and where mutex was locked.
7676
func (m *Mutex) Unlock() {
7777
_, file, line, _ := runtime.Caller(1)
7878
caller := fmt.Sprintf("%s:%d", file, line)

0 commit comments

Comments
 (0)