Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ tools: force kafka
cd tools/publisher ; go install

format:
gofmt -w -tabwidth=2 -tabs=false kafka
gofmt -w .

clean:

full: format clean kafka tools

.PHONY: force
.PHONY: force
26 changes: 13 additions & 13 deletions converts.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,29 @@
package kafka

import (
"encoding/binary"
"encoding/binary"
)

func uint16bytes(value int) []byte {
result := make([]byte, 2)
binary.BigEndian.PutUint16(result, uint16(value))
return result
result := make([]byte, 2)
binary.BigEndian.PutUint16(result, uint16(value))
return result
}

func uint32bytes(value int) []byte {
result := make([]byte, 4)
binary.BigEndian.PutUint32(result, uint32(value))
return result
result := make([]byte, 4)
binary.BigEndian.PutUint32(result, uint32(value))
return result
}

func uint32toUint32bytes(value uint32) []byte {
result := make([]byte, 4)
binary.BigEndian.PutUint32(result, value)
return result
result := make([]byte, 4)
binary.BigEndian.PutUint32(result, value)
return result
}

func uint64ToUint64bytes(value uint64) []byte {
result := make([]byte, 8)
binary.BigEndian.PutUint64(result, value)
return result
result := make([]byte, 8)
binary.BigEndian.PutUint64(result, value)
return result
}
4 changes: 2 additions & 2 deletions tools/consumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ func main() {
}
}

quit := make(chan struct{})
if consumerForever {
quit := make(chan struct{})
go func() {
sigIn := make(chan os.Signal)
signal.Notify(sigIn)
Expand All @@ -108,7 +108,7 @@ func main() {
}
}
} else {
broker.Consume(consumerCallback)
broker.Consume(consumerCallback, quit)
}

if payloadFile != nil {
Expand Down