Skip to content

Commit

Permalink
Fix header key for multiple headers
Browse files Browse the repository at this point in the history
  • Loading branch information
iradul committed Feb 4, 2019
1 parent 4aa3454 commit d07e089
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions k2ws/json-message.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ type jsonMessage struct {
}

type jsonHeader struct {
Key *string `json:"key"`
Value string `json:"value"`
Key string `json:"key"`
Value string `json:"value"`
}

var rexJSONVal = regexp.MustCompile(`}$`)
Expand All @@ -47,7 +47,7 @@ func JSONBytefy(msg *kafka.Message, messageType string) ([]byte, error) {
}

for _, header := range msg.Headers {
jsonMsg.Headers = append(jsonMsg.Headers, jsonHeader{Key: &header.Key, Value: string(header.Value)})
jsonMsg.Headers = append(jsonMsg.Headers, jsonHeader{Key: header.Key, Value: string(header.Value)})
}

b, err := json.Marshal(jsonMsg)
Expand Down

0 comments on commit d07e089

Please sign in to comment.