my computer is about to die!!!
This commit is contained in:
1 parent
d863dc3bd1
commit
e80f2601ab
13 files changed
+244
-11
No files matched your search
@@ -2,7 +2,8 @@ package contract
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/didiercrunch/filou/helper"
|
||||
)
|
||||
|
||||
type AcceptedContract struct {
|
||||
@@ -21,13 +22,6 @@ func listContains(lst []string, elm string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func joinAsError(msg []string) error {
|
||||
if len(msg) > 0 {
|
||||
return errors.New(strings.Join(msg, "\n"))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func getFirstItemInList1ThatIsAlsoInList2(lst1, lst2 []string) (string, error) {
|
||||
for _, elm := range lst1 {
|
||||
if listContains(lst2, elm) {
|
||||
@@ -75,5 +69,5 @@ func GetAcceptedContract(prvCtr *PrivateContract, pubCtr *PublicContract) (*Acce
|
||||
errs = append(errs, err.Error())
|
||||
}
|
||||
|
||||
return ret, joinAsError(errs)
|
||||
return ret, helper.JoinAsError(errs)
|
||||
}
|
||||
Reference in new issue
Block a user