A mutex in a test struct ...
This commit is contained in:
		
							parent
							
								
									7280ae1ebc
								
							
						
					
					
						commit
						6b46eb46e2
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -11,6 +11,7 @@ import (
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"path/filepath"
 | 
						"path/filepath"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
						"sync"
 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
| 
						 | 
					@ -510,9 +511,12 @@ func TestServer_Curl_Publish_Poll(t *testing.T) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type testMailer struct {
 | 
					type testMailer struct {
 | 
				
			||||||
	count int
 | 
						count int
 | 
				
			||||||
 | 
						mu sync.Mutex
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (t *testMailer) Send(to string, m *message) error {
 | 
					func (t *testMailer) Send(to string, m *message) error {
 | 
				
			||||||
 | 
						t.mu.Lock()
 | 
				
			||||||
 | 
						defer t.mu.Unlock()
 | 
				
			||||||
	t.count++
 | 
						t.count++
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue