Debian Codegraph @

detect.go

raw symbols SCIP
1 package clipper
2
3 import "bytes"
4
5 type MultiErr []error
6
7 func (me MultiErr) Error() string {
8 b := &bytes.Buffer{}
9 for _, e := range me {
10 b.WriteString(e.Error())
11 b.WriteByte(';')
12 }
13 return b.String()
14 }
15
16 // GetClipboard iterates through the given clipboards and returns the first one that works.
17 func GetClipboard(clips ...Clipboard) (clip Clipboard, err error) {
18 var errs MultiErr
19
20 for _, clip := range clips {
21 if err = clip.Init(); err == nil {
22 return clip, nil
23 }
24 errs = append(errs, err)
25 }
26 return nil, errs
27 }