Skip to content

Commit

Permalink
Automated lint fixes [dependabot skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
Bot committed Jul 11, 2024
1 parent 6db3a16 commit b9140c9
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions examples/go/measurements.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ func CheckErr(err error) {

func consumerClose(channelClose stream.ChannelClose) {
event := <-channelClose
fmt.Printf("Consumer: %s closed on the stream: %s, reason: %s \n", event.Name, event.StreamName, event.Reason)
fmt.Printf(
"Consumer: %s closed on the stream: %s, reason: %s \n",
event.Name,
event.StreamName,
event.Reason,
)
}

func generateDataID(pmuId int, nMeasures int) map[string]*grid.Data {
Expand Down Expand Up @@ -117,7 +122,9 @@ func main() {
messageProperties := make(map[string]interface{})
messageProperties["Id"] = uuid.New().String()
messageProperties["type"] = "DataSet"
messageProperties["timestampId"] = int64(math.Round(float64(time.Now().UnixMilli())/20) * 20)
messageProperties["timestampId"] = int64(
math.Round(float64(time.Now().UnixMilli())/20) * 20,
)
messageProperties["producerId"] = data.GetProducerId()
message.ApplicationProperties = messageProperties
err := producer.Send(message)
Expand All @@ -136,8 +143,14 @@ func main() {
data := &grid.DataSet{}
err := proto.Unmarshal(message.GetData(), data)
for measurement_id, measurement := range data.GetData() {
fmt.Printf("consumer name: %s, measurement_id: %s, measurement_time %d, measurement_type %d, measurement_value %d\n ",
consumerContext.Consumer.GetName(), measurement_id, measurement.DataType, *measurement.Value, measurement.MeasuredAt)
fmt.Printf(
"consumer name: %s, measurement_id: %s, measurement_time %d, measurement_type %d, measurement_value %d\n ",
consumerContext.Consumer.GetName(),
measurement_id,
measurement.DataType,
*measurement.Value,
measurement.MeasuredAt,
)
}
CheckErr(err)
}
Expand Down

0 comments on commit b9140c9

Please sign in to comment.