mirror of
https://github.com/openziti/ziti.git
synced 2026-10-12 07:18:36 +00:00
Allow router to be shutdown for tests
This commit is contained in:
@@ -591,3 +591,20 @@ func (network *Network) GetServiceCache() Cache {
|
||||
type Cache interface {
|
||||
RemoveFromCache(id string)
|
||||
}
|
||||
|
||||
type MultipleErrors []error
|
||||
|
||||
func (e MultipleErrors) Error() string {
|
||||
if len(e) == 0 {
|
||||
return "no errors occurred"
|
||||
}
|
||||
if len(e) == 1 {
|
||||
return e[0].Error()
|
||||
}
|
||||
buf := strings.Builder{}
|
||||
buf.WriteString("multiple errors occurred")
|
||||
for idx, err := range e {
|
||||
buf.WriteString(fmt.Sprintf(" %v: %v", idx, err))
|
||||
}
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user