diff options
Diffstat (limited to 'vendor/github.com/graphql-go/graphql/gqlerrors/sortutil.go')
-rw-r--r-- | vendor/github.com/graphql-go/graphql/gqlerrors/sortutil.go | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/vendor/github.com/graphql-go/graphql/gqlerrors/sortutil.go b/vendor/github.com/graphql-go/graphql/gqlerrors/sortutil.go deleted file mode 100644 index 300a9407..00000000 --- a/vendor/github.com/graphql-go/graphql/gqlerrors/sortutil.go +++ /dev/null @@ -1,30 +0,0 @@ -package gqlerrors - -import "bytes" - -type FormattedErrors []FormattedError - -func (errs FormattedErrors) Len() int { - return len(errs) -} - -func (errs FormattedErrors) Swap(i, j int) { - errs[i], errs[j] = errs[j], errs[i] -} - -func (errs FormattedErrors) Less(i, j int) bool { - mCompare := bytes.Compare([]byte(errs[i].Message), []byte(errs[j].Message)) - lesserLine := errs[i].Locations[0].Line < errs[j].Locations[0].Line - eqLine := errs[i].Locations[0].Line == errs[j].Locations[0].Line - lesserColumn := errs[i].Locations[0].Column < errs[j].Locations[0].Column - if mCompare < 0 { - return true - } - if mCompare == 0 && lesserLine { - return true - } - if mCompare == 0 && eqLine && lesserColumn { - return true - } - return false -} |