-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheprefpreon.go
More file actions
57 lines (40 loc) · 1.08 KB
/
eprefpreon.go
File metadata and controls
57 lines (40 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package errpref
import "sync"
type errPrefPreon struct {
lock *sync.Mutex
}
// ptr() - Returns a pointer to a new instance of
// errPrefPreon.
//
func (ePrefPreon errPrefPreon) ptr() *errPrefPreon {
if ePrefPreon.lock == nil {
ePrefPreon.lock = new(sync.Mutex)
}
ePrefPreon.lock.Lock()
defer ePrefPreon.lock.Unlock()
return &errPrefPreon{}
}
// getMinErrPrefLineLength - Returns the Minimum Error Prefix Line
// Length in number of characters.
//
// If users attempt to set the value of the Error Prefix Line
// Length to a value less than this minimum, parent functions will
// either return an error or reset the value to the default Error
// Prefix Line Length.
//
func (ePrefPreon *errPrefPreon) getMinErrPrefLineLength() uint {
if ePrefPreon.lock == nil {
ePrefPreon.lock = new(sync.Mutex)
}
ePrefPreon.lock.Lock()
defer ePrefPreon.lock.Unlock()
return 10
}
func (ePrefPreon *errPrefPreon) getDefaultErrPrefLineLength() uint {
if ePrefPreon.lock == nil {
ePrefPreon.lock = new(sync.Mutex)
}
ePrefPreon.lock.Lock()
defer ePrefPreon.lock.Unlock()
return 40
}