Skip to content

Commit

Permalink
Removed more unsafe operations.
Browse files Browse the repository at this point in the history
  • Loading branch information
vburenin committed Jun 16, 2017
1 parent 08c1cbb commit a3e95bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions server/sqsproto/receive_message/receive_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"strings"

"github.com/vburenin/firempq/apis"
"github.com/vburenin/firempq/enc"
"github.com/vburenin/firempq/log"
"github.com/vburenin/firempq/mpqproto/resp"
"github.com/vburenin/firempq/pqueue"
Expand Down Expand Up @@ -120,7 +119,7 @@ func MakeMessageAttr(name string, sqsAttr *sqsmsg.UserAttribute) *MessageAttribu
return &MessageAttribute{
Name: name,
Type: sqsAttr.Type,
BinaryValue: enc.UnsafeBytesToString(encodedBin),
BinaryValue: string(encodedBin),
}
} else {
return &MessageAttribute{
Expand Down
3 changes: 1 addition & 2 deletions server/sqsproto/send_message/send_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"strings"

"github.com/vburenin/firempq/conf"
"github.com/vburenin/firempq/enc"
"github.com/vburenin/firempq/idgen"
"github.com/vburenin/firempq/log"
"github.com/vburenin/firempq/pqueue"
Expand Down Expand Up @@ -238,7 +237,7 @@ func PushAMessage(pq *pqueue.PQueue, senderId string, paramList []string) sqs_re
if marshalErr != nil {
log.Error("Failed to serialize message payload: %v", err)
}
payload := enc.UnsafeBytesToString(d)
payload := string(d)

resp := pq.Push(msgId, payload, pq.Config().MsgTtl, out.DelaySeconds, 1)
if resp.IsError() {
Expand Down

0 comments on commit a3e95bc

Please sign in to comment.