fix: golangci-lint and gosec warnings

This commit is contained in:
2021-05-16 23:02:46 +02:00
parent f7bb283784
commit ffbc8a793c
22 changed files with 228 additions and 157 deletions

View File

@ -97,26 +97,22 @@ func readTemperature(cmd *cobra.Command, args []string) error {
go func() {
for {
select {
case err, open := <-errorChannel:
if !open {
return
}
flogger.Error("%v", err)
err, open := <-errorChannel
if !open {
return
}
flogger.Error("%v", err)
}
}()
measuredValues := make([]*types.MeasuredValue, 0)
LOOP:
for {
select {
case measuredValue, open := <-measuredValueChannel:
if !open {
break LOOP
}
measuredValues = append(measuredValues, measuredValue)
measuredValue, open := <-measuredValueChannel
if !open {
break LOOP
}
measuredValues = append(measuredValues, measuredValue)
}
err = cli.PrintMeasuredValues(measuredValues, os.Stdout)