Skip to content

Commit 441b083

Browse files
committed
chore(typos): random typos spotted while browsing code
Signed-off-by: Mark Hindess <[email protected]>
1 parent 12c24a8 commit 441b083

19 files changed

+29
-29
lines changed

acl_create_request_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var (
1616
0, 0, 0, 1,
1717
3, // resource type = group
1818
0, 5, 'g', 'r', 'o', 'u', 'p',
19-
3, // resource pattten type = literal
19+
3, // resource pattern type = literal
2020
0, 9, 'p', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l',
2121
0, 4, 'h', 'o', 's', 't',
2222
2, // all

acl_describe_request.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package sarama
22

3-
// DescribeAclsRequest is a secribe acl request type
3+
// DescribeAclsRequest is a describe acl request type
44
type DescribeAclsRequest struct {
55
Version int
66
AclFilter

acl_types.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (a *AclOperation) MarshalText() ([]byte, error) {
6060
return []byte(a.String()), nil
6161
}
6262

63-
// UnmarshalText takes a text reprentation of the operation and converts it to an AclOperation
63+
// UnmarshalText takes a text representation of the operation and converts it to an AclOperation
6464
func (a *AclOperation) UnmarshalText(text []byte) error {
6565
normalized := strings.ToLower(string(text))
6666
mapping := map[string]AclOperation{
@@ -114,7 +114,7 @@ func (a *AclPermissionType) MarshalText() ([]byte, error) {
114114
return []byte(a.String()), nil
115115
}
116116

117-
// UnmarshalText takes a text reprentation of the permission type and converts it to an AclPermissionType
117+
// UnmarshalText takes a text representation of the permission type and converts it to an AclPermissionType
118118
func (a *AclPermissionType) UnmarshalText(text []byte) error {
119119
normalized := strings.ToLower(string(text))
120120
mapping := map[string]AclPermissionType{
@@ -166,7 +166,7 @@ func (a *AclResourceType) MarshalText() ([]byte, error) {
166166
return []byte(a.String()), nil
167167
}
168168

169-
// UnmarshalText takes a text reprentation of the resource type and converts it to an AclResourceType
169+
// UnmarshalText takes a text representation of the resource type and converts it to an AclResourceType
170170
func (a *AclResourceType) UnmarshalText(text []byte) error {
171171
normalized := strings.ToLower(string(text))
172172
mapping := map[string]AclResourceType{
@@ -217,7 +217,7 @@ func (a *AclResourcePatternType) MarshalText() ([]byte, error) {
217217
return []byte(a.String()), nil
218218
}
219219

220-
// UnmarshalText takes a text reprentation of the resource pattern type and converts it to an AclResourcePatternType
220+
// UnmarshalText takes a text representation of the resource pattern type and converts it to an AclResourcePatternType
221221
func (a *AclResourcePatternType) UnmarshalText(text []byte) error {
222222
normalized := strings.ToLower(string(text))
223223
mapping := map[string]AclResourcePatternType{

add_partitions_to_txn_request.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package sarama
22

3-
// AddPartitionsToTxnRequest is a add paartition request
3+
// AddPartitionsToTxnRequest is a add partition request
44
type AddPartitionsToTxnRequest struct {
55
TransactionalID string
66
ProducerID int64

async_producer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type AsyncProducer interface {
5050
// errors to be returned.
5151
Errors() <-chan *ProducerError
5252

53-
// IsTransactional return true when current producer is is transactional.
53+
// IsTransactional return true when current producer is transactional.
5454
IsTransactional() bool
5555

5656
// TxnStatus return current producer transaction status.

balance_strategy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ type assignmentPriorityQueue []*consumerGroupMember
11151115
func (pq assignmentPriorityQueue) Len() int { return len(pq) }
11161116

11171117
func (pq assignmentPriorityQueue) Less(i, j int) bool {
1118-
// order asssignment priority queue in descending order using assignment-count/member-id
1118+
// order assignment priority queue in descending order using assignment-count/member-id
11191119
if len(pq[i].assignments) == len(pq[j].assignments) {
11201120
return strings.Compare(pq[i].id, pq[j].id) > 0
11211121
}

broker.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ func (b *Broker) AsyncProduce(request *ProduceRequest, cb ProduceCallback) error
455455
return
456456
}
457457

458-
// Wellformed response
458+
// Well-formed response
459459
b.updateThrottleMetric(res.ThrottleTime)
460460
cb(res, nil)
461461
},

client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type Client interface {
5050
// topic/partition, as determined by querying the cluster metadata.
5151
Leader(topic string, partitionID int32) (*Broker, error)
5252

53-
// LeaderAndEpoch returns the the leader and its epoch for the current
53+
// LeaderAndEpoch returns the leader and its epoch for the current
5454
// topic/partition, as determined by querying the cluster metadata.
5555
LeaderAndEpoch(topic string, partitionID int32) (*Broker, int32, error)
5656

client_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ func TestClientCoordinatorWithConsumerOffsetsTopic(t *testing.T) {
911911

912912
seedBroker.Returns(coordinatorResponse3)
913913

914-
// Refresh the locally cahced value because it's stale
914+
// Refresh the locally cached value because it's stale
915915
if err := client.RefreshCoordinator("my_group"); err != nil {
916916
t.Error(err)
917917
}

consumer_group.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ func (c *consumerGroup) newSession(ctx context.Context, topics []string, handler
406406
claims = members.Topics
407407

408408
// in the case of stateful balance strategies, hold on to the returned
409-
// assignment metadata, otherwise, reset the statically defined conusmer
409+
// assignment metadata, otherwise, reset the statically defined consumer
410410
// group metadata
411411
if members.UserData != nil {
412412
c.userData = members.UserData

describe_configs_request_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var (
4444
2, // a topic
4545
0, 3, 'f', 'o', 'o', // topic name: foo
4646
255, 255, 255, 255, // no configs
47-
1, // synoms
47+
1, // synonyms
4848
}
4949
)
5050

errors.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ var ErrTransactionNotReady = errors.New("transaction manager: transaction is not
7979
// ErrNonTransactedProducer when calling BeginTxn, CommitTxn or AbortTxn on a non transactional producer.
8080
var ErrNonTransactedProducer = errors.New("transaction manager: you need to add TransactionalID to producer")
8181

82-
// ErrTransitionNotAllowed when txnmgr state transiion is not valid.
82+
// ErrTransitionNotAllowed when txnmgr state transition is not valid.
8383
var ErrTransitionNotAllowed = errors.New("transaction manager: invalid transition attempted")
8484

8585
// ErrCannotTransitionNilError when transition is attempted with an nil error.
@@ -89,7 +89,7 @@ var ErrCannotTransitionNilError = errors.New("transaction manager: cannot transi
8989
var ErrTxnUnableToParseResponse = errors.New("transaction manager: unable to parse response")
9090

9191
// MultiErrorFormat specifies the formatter applied to format multierrors. The
92-
// default implementation is a consensed version of the hashicorp/go-multierror
92+
// default implementation is a condensed version of the hashicorp/go-multierror
9393
// default one
9494
var MultiErrorFormat multierror.ErrorFormatFunc = func(es []error) string {
9595
if len(es) == 1 {

heartbeat_request_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ import (
88
var (
99
basicHeartbeatRequestV0 = []byte{
1010
0, 3, 'f', 'o', 'o', // Group ID
11-
0x00, 0x01, 0x02, 0x03, // Generatiuon ID
11+
0x00, 0x01, 0x02, 0x03, // Generation ID
1212
0, 3, 'b', 'a', 'z', // Member ID
1313
}
1414

1515
basicHeartbeatRequestV3_GID = []byte{
1616
0, 3, 'f', 'o', 'o', // Group ID
17-
0x00, 0x01, 0x02, 0x03, // Generatiuon ID
17+
0x00, 0x01, 0x02, 0x03, // Generation ID
1818
0, 3, 'b', 'a', 'z', // Member ID
1919
0, 3, 'g', 'i', 'd', // Group Instance ID
2020
}
2121
basicHeartbeatRequestV3_NOGID = []byte{
2222
0, 3, 'f', 'o', 'o', // Group ID
23-
0x00, 0x01, 0x02, 0x03, // Generatiuon ID
23+
0x00, 0x01, 0x02, 0x03, // Generation ID
2424
0, 3, 'b', 'a', 'z', // Member ID
2525
255, 255, // Group Instance ID
2626
}

join_group_response_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ var (
184184
0, 3, 'f', 'o', 'o', // Leader ID
185185
0, 3, 'b', 'a', 'r', // Member ID
186186
0, 0, 0, 1, // One member info
187-
0, 3, 'm', 'i', 'd', // memeberId
187+
0, 3, 'm', 'i', 'd', // memberId
188188
0, 3, 'g', 'i', 'd', // GroupInstanceId
189189
0, 0, 0, 3, 1, 2, 3, // Metadata
190190
}

message_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var (
5151
0xFF, 0xFF, 0xFF, 0xFF, // key
5252
0x00, 0x00, 0x00, 0x0f, // len
5353
0x04, 0x22, 0x4D, 0x18, // LZ4 magic number
54-
100, // LZ4 flags: version 01, block indepedant, content checksum
54+
100, // LZ4 flags: version 01, block independent, content checksum
5555
112, 185, 0, 0, 0, 0, // LZ4 data
5656
5, 93, 204, 2, // LZ4 checksum
5757
}

offset_manager.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ func (om *offsetManager) handleResponse(broker *Broker, req *OffsetCommitRequest
359359
// nothing wrong but we didn't commit, we'll get it next time round
360360
case ErrFencedInstancedId:
361361
pom.handleError(err)
362-
// TODO close the whole consumer for instacne fenced....
362+
// TODO close the whole consumer for instance fenced....
363363
om.tryCancelSession()
364364
case ErrUnknownTopicOrPartition:
365365
// let the user know *and* try redispatching - if topic-auto-create is

packet_decoder.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type pushDecoder interface {
5555
// Saves the offset into the input buffer as the location to actually read the calculated value when able.
5656
saveOffset(in int)
5757

58-
// Returns the length of data to reserve for the input of this encoder (eg 4 bytes for a CRC32).
58+
// Returns the length of data to reserve for the input of this encoder (e.g. 4 bytes for a CRC32).
5959
reserveLength() int
6060

6161
// Indicates that all required data is now available to calculate and check the field.

sync_producer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type SyncProducer interface {
3333
// TxnStatus return current producer transaction status.
3434
TxnStatus() ProducerTxnStatusFlag
3535

36-
// IsTransactional return true when current producer is is transactional.
36+
// IsTransactional return true when current producer is transactional.
3737
IsTransactional() bool
3838

3939
// BeginTxn mark current transaction as ready.

transaction_manager.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ type ProducerTxnStatusFlag int16
1414
const (
1515
// ProducerTxnFlagUninitialized when txnmgr is created
1616
ProducerTxnFlagUninitialized ProducerTxnStatusFlag = 1 << iota
17-
// ProducerTxnFlagInitializing when txnmgr is initilizing
17+
// ProducerTxnFlagInitializing when txnmgr is initializing
1818
ProducerTxnFlagInitializing
1919
// ProducerTxnFlagReady when is ready to receive transaction
2020
ProducerTxnFlagReady
2121
// ProducerTxnFlagInTransaction when transaction is started
2222
ProducerTxnFlagInTransaction
2323
// ProducerTxnFlagEndTransaction when transaction will be committed
2424
ProducerTxnFlagEndTransaction
25-
// ProducerTxnFlagInError whan having abortable or fatal error
25+
// ProducerTxnFlagInError when having abortable or fatal error
2626
ProducerTxnFlagInError
2727
// ProducerTxnFlagCommittingTransaction when committing txn
2828
ProducerTxnFlagCommittingTransaction
@@ -117,13 +117,13 @@ var producerTxnTransitions = map[ProducerTxnStatusFlag][]ProducerTxnStatusFlag{
117117
ProducerTxnFlagReady,
118118
ProducerTxnFlagInError,
119119
},
120-
// When we need are initilizing
120+
// When we need are initializing
121121
ProducerTxnFlagInitializing: {
122122
ProducerTxnFlagInitializing,
123123
ProducerTxnFlagReady,
124124
ProducerTxnFlagInError,
125125
},
126-
// When we have initilized transactional producer
126+
// When we have initialized transactional producer
127127
ProducerTxnFlagReady: {
128128
ProducerTxnFlagInTransaction,
129129
},
@@ -660,7 +660,7 @@ func (t *transactionManager) finishTransaction(commit bool) error {
660660
t.mutex.Lock()
661661
defer t.mutex.Unlock()
662662

663-
// Ensure no error when committing or abording
663+
// Ensure no error when committing or aborting
664664
if commit && t.currentTxnStatus()&ProducerTxnFlagInError != 0 {
665665
return t.lastError
666666
} else if !commit && t.currentTxnStatus()&ProducerTxnFlagFatalError != 0 {

0 commit comments

Comments
 (0)