File tree 2 files changed +9
-9
lines changed
2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
1
root = true
2
2
3
3
[* ]
4
- indent_style = tabs
4
+ indent_style = tab
5
5
indent_size = 2
6
6
end_of_line = lf
7
7
charset = utf-8
Original file line number Diff line number Diff line change 1
1
package gock
2
2
3
3
import (
4
- "sync"
4
+ "sync"
5
5
)
6
6
7
7
// storeMutex is used interally for store synchronization.
@@ -30,15 +30,15 @@ func Register(mock Mock) {
30
30
31
31
// GetAll returns the current stack of registed mocks.
32
32
func GetAll () []Mock {
33
- storeMutex .RLock ()
34
- defer storeMutex .RUnlock ()
33
+ storeMutex .RLock ()
34
+ defer storeMutex .RUnlock ()
35
35
return mocks
36
36
}
37
37
38
38
// Exists checks if the given Mock is already registered.
39
39
func Exists (m Mock ) bool {
40
- storeMutex .RLock ()
41
- defer storeMutex .RUnlock ()
40
+ storeMutex .RLock ()
41
+ defer storeMutex .RUnlock ()
42
42
for _ , mock := range mocks {
43
43
if mock == m {
44
44
return true
@@ -51,7 +51,7 @@ func Exists(m Mock) bool {
51
51
func Remove (m Mock ) {
52
52
for i , mock := range mocks {
53
53
if mock == m {
54
- storeMutex .Lock ()
54
+ storeMutex .Lock ()
55
55
mocks = append (mocks [:i ], mocks [i + 1 :]... )
56
56
storeMutex .Unlock ()
57
57
}
@@ -68,8 +68,8 @@ func Flush() {
68
68
// Pending returns an slice of pending mocks.
69
69
func Pending () []Mock {
70
70
Clean ()
71
- storeMutex .RLock ()
72
- defer storeMutex .RUnlock ()
71
+ storeMutex .RLock ()
72
+ defer storeMutex .RUnlock ()
73
73
return mocks
74
74
}
75
75
You can’t perform that action at this time.
0 commit comments