Browse Source

Address github CR comments

Jacopo Silvestro 9 years ago
parent
commit
b0701275b1
2 changed files with 4 additions and 1 deletions
  1. 1 1
      mocks/async_producer.go
  2. 3 0
      mocks/mocks.go

+ 1 - 1
mocks/async_producer.go

@@ -8,7 +8,7 @@ import (
 
 // AsyncProducer implements sarama's Producer interface for testing purposes.
 // Before you can send messages to it's Input channel, you have to set expectations
-// so it knows how to handle the input; it returns and error if the numer of messages
+// so it knows how to handle the input; it returns an error if the number of messages
 // received is bigger then the number of expectations set. You can also set a
 // function in each expectation so that the message value is checked by this function
 // and an error is returned if the match fails.

+ 3 - 0
mocks/mocks.go

@@ -27,8 +27,11 @@ type ErrorReporter interface {
 	Errorf(string, ...interface{})
 }
 
+// ValueChecker is a function type to be set in each expectation of the producer mocks
+// to check the value passed.
 type ValueChecker func(val []byte) error
 
+// This function is used inside the mocks unit tests to generate ValueCheckers
 func generateRegexpChecker(re string) func([]byte) error {
 	return func(val []byte) error {
 		matched, err := regexp.MatchString(re, string(val))