fix(pkg/sensor): use context to terminate go routines
This commit is contained in:
@ -5,8 +5,12 @@ import "fmt"
|
||||
func FormatErrors(errors []error) error {
|
||||
if len(errors) > 0 {
|
||||
errMsg := ""
|
||||
for _, err := range errors {
|
||||
errMsg = fmt.Sprintf("%v\n%v", errMsg, err.Error())
|
||||
for i, err := range errors {
|
||||
if i == 0 {
|
||||
errMsg = fmt.Sprintf("%v", err.Error())
|
||||
} else {
|
||||
errMsg = fmt.Sprintf("%v\n%v", errMsg, err.Error())
|
||||
}
|
||||
}
|
||||
return fmt.Errorf(errMsg)
|
||||
}
|
||||
|
Reference in New Issue
Block a user