aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/graphql-go/graphql/gqlerrors/sortutil.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-29 18:58:42 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-29 18:58:42 +0200
commit8fa0b258ac89781dae269790a4bde09cbcd2f324 (patch)
treeb9bcf0826f5739f128de52123447cede23291c02 /vendor/github.com/graphql-go/graphql/gqlerrors/sortutil.go
parent6363518c85cbd8247a5f6507b8a1dd3903cfb71d (diff)
downloadgit-bug-8fa0b258ac89781dae269790a4bde09cbcd2f324.tar.gz
cleaning
Diffstat (limited to 'vendor/github.com/graphql-go/graphql/gqlerrors/sortutil.go')
-rw-r--r--vendor/github.com/graphql-go/graphql/gqlerrors/sortutil.go30
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
-}