Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs in Makefile and Consumer #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
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
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
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