Remove nsenter packages from vendor

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2019-09-20 16:15:13 +05:30
committed by mergify[bot]
parent 70d49b4e47
commit d4a67c05f3
246 changed files with 10204 additions and 3356 deletions

View File

@ -1,3 +1,5 @@
// untested sections: 2
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 5
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 5
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 3
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 2
package matchers
import (

View File

@ -0,0 +1,57 @@
// untested sections: 1
package matchers
import (
"fmt"
"reflect"
"github.com/onsi/gomega/format"
)
type BeElementOfMatcher struct {
Elements []interface{}
}
func (matcher *BeElementOfMatcher) Match(actual interface{}) (success bool, err error) {
if reflect.TypeOf(actual) == nil {
return false, fmt.Errorf("BeElement matcher expects actual to be typed")
}
length := len(matcher.Elements)
valueAt := func(i int) interface{} {
return matcher.Elements[i]
}
// Special handling of a single element of type Array or Slice
if length == 1 && isArrayOrSlice(valueAt(0)) {
element := valueAt(0)
value := reflect.ValueOf(element)
length = value.Len()
valueAt = func(i int) interface{} {
return value.Index(i).Interface()
}
}
var lastError error
for i := 0; i < length; i++ {
matcher := &EqualMatcher{Expected: valueAt(i)}
success, err := matcher.Match(actual)
if err != nil {
lastError = err
continue
}
if success {
return true, nil
}
}
return false, lastError
}
func (matcher *BeElementOfMatcher) FailureMessage(actual interface{}) (message string) {
return format.Message(actual, "to be an element of", matcher.Elements)
}
func (matcher *BeElementOfMatcher) NegatedFailureMessage(actual interface{}) (message string) {
return format.Message(actual, "not to be an element of", matcher.Elements)
}

View File

@ -1,3 +1,5 @@
// untested sections: 2
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 2
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 2
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 2
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 2
package matchers
import "github.com/onsi/gomega/format"

View File

@ -1,3 +1,5 @@
// untested sections: 4
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 3
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 3
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 2
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 3
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 2
package matchers
import (
@ -22,19 +24,21 @@ func (matcher *ContainElementMatcher) Match(actual interface{}) (success bool, e
}
value := reflect.ValueOf(actual)
var keys []reflect.Value
var valueAt func(int) interface{}
if isMap(actual) {
keys = value.MapKeys()
keys := value.MapKeys()
valueAt = func(i int) interface{} {
return value.MapIndex(keys[i]).Interface()
}
} else {
valueAt = func(i int) interface{} {
return value.Index(i).Interface()
}
}
var lastError error
for i := 0; i < value.Len(); i++ {
var success bool
var err error
if isMap(actual) {
success, err = elemMatcher.Match(value.MapIndex(keys[i]).Interface())
} else {
success, err = elemMatcher.Match(value.Index(i).Interface())
}
success, err := elemMatcher.Match(valueAt(i))
if err != nil {
lastError = err
continue

View File

@ -1,3 +1,5 @@
// untested sections: 2
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 2
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 6
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections:10
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 2
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 3
package matchers
import (

View File

@ -1,3 +1,5 @@
// untested sections: 5
package matchers
import (

View File

@ -1,6 +1,5 @@
package bipartitegraph
import "errors"
import "fmt"
import . "github.com/onsi/gomega/matchers/support/goraph/node"
@ -28,7 +27,7 @@ func NewBipartiteGraph(leftValues, rightValues []interface{}, neighbours func(in
for j, rightValue := range rightValues {
neighbours, err := neighbours(leftValue, rightValue)
if err != nil {
return nil, errors.New(fmt.Sprintf("error determining adjacency for %v and %v: %s", leftValue, rightValue, err.Error()))
return nil, fmt.Errorf("error determining adjacency for %v and %v: %s", leftValue, rightValue, err.Error())
}
if neighbours {

View File

@ -6,6 +6,9 @@ See the docs for Gomega for documentation on the matchers
http://onsi.github.io/gomega/
*/
// untested sections: 11
package matchers
import (