mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-05 03:01:11 +00:00
21 lines
325 B
Go
21 lines
325 B
Go
package common
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
// Assert test is true, panic otherwise
|
|
func Assert(test bool) {
|
|
if !test {
|
|
panic("Assertion failure")
|
|
}
|
|
}
|
|
|
|
func ErrorMessages(errors []error) string {
|
|
var result []string
|
|
for _, err := range errors {
|
|
result = append(result, err.Error())
|
|
}
|
|
return strings.Join(result, "\n")
|
|
}
|