Repository: elliotchance/gedcom
Pull request #287 (2020-01-23 20:27:30)

CI: dep to go modules


<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/elliotchance/gedcom/287)
<!-- Reviewable:end -->


codecov-io: # [Codecov](https://codecov.io/gh/elliotchance/gedcom/pull/287?src=pr&el=h1) Report
> Merging [#287](https://codecov.io/gh/elliotchance/gedcom/pull/287?src=pr&el=desc) into [master](https://codecov.io/gh/elliotchance/gedcom/commit/f7454d0deb87dcec23632e12e62aec84ab02c870?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/elliotchance/gedcom/pull/287/graphs/tree.svg?width=650&token=gtwWzggLwp&height=150&src=pr)](https://codecov.io/gh/elliotchance/gedcom/pull/287?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master     #287   +/-   ##
=======================================
  Coverage   65.64%   65.64%           
=======================================
  Files         207      207           
  Lines        6678     6678           
=======================================
  Hits         4384     4384           
  Misses       2162     2162           
  Partials      132      132
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/elliotchance/gedcom/pull/287?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/elliotchance/gedcom/pull/287?src=pr&el=footer). Last update [f7454d0...652a779](https://codecov.io/gh/elliotchance/gedcom/pull/287?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/.travis.yml b/.travis.yml
index 4b512ce..7b96e0e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,44 +1,19 @@
 language: go
 
-go:
-  - 1.13.x
-  - 1.12.x
-  - 1.11.x
-  - 1.10.x
-  - 1.9.x
-
-stages:
-  - Test
-  - name: Release
-    if: tag =~ ^v
-
-before_install:
-  - DEP_VERSION="0.4.1"
-  # Download the binary to bin folder in $GOPATH
-  - curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
-  # Make the binary executable
-  - chmod +x $GOPATH/bin/dep
-
-install:
-  - go get -u github.com/elliotchance/ghost
-  - dep ensure
-
-script:
-  - if [[ "$TRAVIS_GO_VERSION" == 1.13* ]]; then
-      make checks;
-      make test-coverage;
-    else
-      make test;
-    fi
-
-after_success:
-  - if [[ "$TRAVIS_GO_VERSION" == 1.13* ]]; then
-      bash <(curl -s https://codecov.io/bash);
-    fi
+go: 1.13.x
 
 jobs:
   include:
+    - stage: Test
+      script:
+        - $(exit $(go fmt ./... | wc -l))
+        - make test-coverage
+
+      after_success:
+        - bash <(curl -s https://codecov.io/bash)
+
     - stage: Release
+      if: tag =~ ^v
       script:
         - GOOS=linux GOARCH=amd64 EXT="" make zip
         - GOOS=darwin GOARCH=amd64 EXT="" make zip
diff --git a/Gopkg.lock b/Gopkg.lock
deleted file mode 100644
index 97b10b7..0000000
--- a/Gopkg.lock
+++ /dev/null
@@ -1,82 +0,0 @@
-# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
-
-
-[[projects]]
-  name = "github.com/cheggaaa/pb"
-  packages = ["."]
-  revision = "1cc5bbe20449079337944d56292c7383510c534c"
-  version = "v1.0.27"
-
-[[projects]]
-  name = "github.com/davecgh/go-spew"
-  packages = ["spew"]
-  revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73"
-  version = "v1.1.1"
-
-[[projects]]
-  name = "github.com/elliotchance/tf"
-  packages = ["."]
-  revision = "e761b3dfec90f49b2e9f57a06c3cda5a500b710c"
-  version = "v1.5.0"
-
-[[projects]]
-  name = "github.com/google/go-cmp"
-  packages = [
-    "cmp",
-    "cmp/cmpopts",
-    "cmp/internal/diff",
-    "cmp/internal/function",
-    "cmp/internal/value"
-  ]
-  revision = "3af367b6b30c263d47e8895973edcca9a49cf029"
-  version = "v0.2.0"
-
-[[projects]]
-  name = "github.com/mattn/go-runewidth"
-  packages = ["."]
-  revision = "3ee7d812e62a0804a7d0a324e0249ca2db3476d3"
-  version = "v0.0.4"
-
-[[projects]]
-  name = "github.com/pmezard/go-difflib"
-  packages = ["difflib"]
-  revision = "792786c7400a136282c1664665ae0a8db921c6c2"
-  version = "v1.0.0"
-
-[[projects]]
-  name = "github.com/stretchr/testify"
-  packages = ["assert"]
-  revision = "ffdc059bfe9ce6a4e144ba849dbedead332c6053"
-  version = "v1.3.0"
-
-[[projects]]
-  branch = "master"
-  name = "golang.org/x/sys"
-  packages = ["unix"]
-  revision = "2be51725563103c17124a318f1745b66f2347acb"
-
-[[projects]]
-  name = "golang.org/x/text"
-  packages = [
-    "feature/plural",
-    "internal",
-    "internal/catmsg",
-    "internal/format",
-    "internal/gen",
-    "internal/number",
-    "internal/stringset",
-    "internal/tag",
-    "language",
-    "message",
-    "message/catalog",
-    "unicode/cldr"
-  ]
-  revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0"
-  version = "v0.3.0"
-
-[solve-meta]
-  analyzer-name = "dep"
-  analyzer-version = 1
-  inputs-digest = "faf11ddfb859baccb4f0085f294f446ce1e33f757b284162bd3cb96133b33d59"
-  solver-name = "gps-cdcl"
-  solver-version = 1
diff --git a/Gopkg.toml b/Gopkg.toml
deleted file mode 100644
index eb02cc9..0000000
--- a/Gopkg.toml
+++ /dev/null
@@ -1,23 +0,0 @@
-[[constraint]]
-  name = "github.com/stretchr/testify"
-  version = "1.2.2"
-
-[[constraint]]
-  name = "golang.org/x/text"
-  version = "0.3.0"
-
-[prune]
-  go-tests = true
-  unused-packages = true
-
-[[constraint]]
-  name = "github.com/elliotchance/tf"
-  version = "^1.5.0"
-
-[[constraint]]
-  name = "github.com/cheggaaa/pb"
-  version = "^1.0.27"
-
-[[constraint]]
-  name = "github.com/google/go-cmp"
-  version = "0.2.0"
diff --git a/Makefile b/Makefile
index 8b42dc3..b3012a6 100644
--- a/Makefile
+++ b/Makefile
@@ -13,14 +13,6 @@ test-coverage:
 		fi \
 	done
 
-check-go-fmt:
-	exit $$(go fmt ./... | wc -l)
-
-check-ghost:
-	exit $$(ghost -max-line-complexity 2 -ignore-tests $$(find . -name "*.go" | grep -v vendor))
-
-checks: check-go-fmt check-ghost
-
 zip:
 	rm -rf bin
 	mkdir bin
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..1f2ad7c
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,15 @@
+module github.com/elliotchance/gedcom
+
+go 1.13
+
+require (
+	github.com/cheggaaa/pb v1.0.27
+	github.com/davecgh/go-spew v1.1.1
+	github.com/elliotchance/tf v1.5.0
+	github.com/google/go-cmp v0.2.0
+	github.com/mattn/go-runewidth v0.0.4
+	github.com/pmezard/go-difflib v1.0.0
+	github.com/stretchr/testify v1.3.0
+	golang.org/x/sys v0.0.0-20190114130336-2be517255631
+	golang.org/x/text v0.3.0
+)
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..9108d28
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,20 @@
+github.com/cheggaaa/pb v1.0.27 h1:wIkZHkNfC7R6GI5w7l/PdAdzXzlrbcI3p8OAlnkTsnc=
+github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/elliotchance/tf v1.5.0 h1:n2isDad6M0Rs5PY6tKf+XQeQzWjNUnkNoR01n+77chg=
+github.com/elliotchance/tf v1.5.0/go.mod h1:kGcqbxJGXu9dJruTmexwstSLQ347JbqxPqimD9Rkmlw=
+github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
+github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+golang.org/x/sys v0.0.0-20190114130336-2be517255631 h1:g/5trXm6f9Tm+ochb21RlFNnF63lt+elB9hVBqtPu5Y=
+golang.org/x/sys v0.0.0-20190114130336-2be517255631/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
diff --git a/q/functions.go b/q/functions.go
index 2aa3257..57b2b92 100644
--- a/q/functions.go
+++ b/q/functions.go
@@ -10,5 +10,5 @@ var Functions = map[string]Expression{
 	"Last":                         &LastExpr{},
 	"Length":                       &LengthExpr{},
 	"MergeDocumentsAndIndividuals": &MergeDocumentsAndIndividualsExpr{},
-	"Only": &OnlyExpr{},
+	"Only":                         &OnlyExpr{},
 }


Test patch:
diff --git a/individual_nodes_test.go b/individual_nodes_test.go
index 47e1ff7..95c0417 100644
--- a/individual_nodes_test.go
+++ b/individual_nodes_test.go
@@ -30,15 +30,15 @@ var individualNodesTests = map[string]struct {
 	WantMerge   gedcom.IndividualNodes
 }{
 	"BothDocumentsEmpty": {
-		Doc1: gedcom.NewDocument(),
-		Doc2: gedcom.NewDocument(),
+		Doc1:                      gedcom.NewDocument(),
+		Doc2:                      gedcom.NewDocument(),
 		MinimumWeightedSimilarity: 0.0,
 		PreferPointerAbove:        1.0,
 		WantCompare:               gedcom.IndividualComparisons{},
 	},
 	"Doc2Empty": {
-		Doc1: gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot}),
-		Doc2: gedcom.NewDocument(),
+		Doc1:                      gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot}),
+		Doc2:                      gedcom.NewDocument(),
 		MinimumWeightedSimilarity: 0.0,
 		PreferPointerAbove:        1.0,
 		WantCompare: gedcom.IndividualComparisons{
@@ -49,8 +49,8 @@ var individualNodesTests = map[string]struct {
 		},
 	},
 	"Doc1Empty": {
-		Doc1: gedcom.NewDocument(),
-		Doc2: gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot}),
+		Doc1:                      gedcom.NewDocument(),
+		Doc2:                      gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot}),
 		MinimumWeightedSimilarity: 0.0,
 		PreferPointerAbove:        1.0,
 		WantCompare: gedcom.IndividualComparisons{
@@ -61,8 +61,8 @@ var individualNodesTests = map[string]struct {
 		},
 	},
 	"SameIndividualInBothDocuments": {
-		Doc1: gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot}),
-		Doc2: gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot}),
+		Doc1:                      gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot}),
+		Doc2:                      gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot}),
 		MinimumWeightedSimilarity: 0.0,
 		PreferPointerAbove:        1.0,
 		WantCompare: gedcom.IndividualComparisons{
@@ -73,8 +73,8 @@ var individualNodesTests = map[string]struct {
 		},
 	},
 	"SameIndividualsInDifferentOrder": {
-		Doc1: gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot, john, jane}),
-		Doc2: gedcom.NewDocumentWithNodes(gedcom.Nodes{jane, elliot, john}),
+		Doc1:                      gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot, john, jane}),
+		Doc2:                      gedcom.NewDocumentWithNodes(gedcom.Nodes{jane, elliot, john}),
 		MinimumWeightedSimilarity: 0.0,
 		PreferPointerAbove:        1.0,
 		WantCompare: gedcom.IndividualComparisons{
@@ -89,8 +89,8 @@ var individualNodesTests = map[string]struct {
 		},
 	},
 	"ZeroMinimumSimilarity": {
-		Doc1: gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot, jane}),
-		Doc2: gedcom.NewDocumentWithNodes(gedcom.Nodes{jane, john}),
+		Doc1:                      gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot, jane}),
+		Doc2:                      gedcom.NewDocumentWithNodes(gedcom.Nodes{jane, john}),
 		MinimumWeightedSimilarity: 0.0,
 		PreferPointerAbove:        1.0,
 		WantCompare: gedcom.IndividualComparisons{
@@ -116,8 +116,8 @@ var individualNodesTests = map[string]struct {
 		},
 	},
 	"OneMatch": {
-		Doc1: gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot, jane}),
-		Doc2: gedcom.NewDocumentWithNodes(gedcom.Nodes{jane, john}),
+		Doc1:                      gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot, jane}),
+		Doc2:                      gedcom.NewDocumentWithNodes(gedcom.Nodes{jane, john}),
 		MinimumWeightedSimilarity: 0.75,
 		PreferPointerAbove:        1.0,
 		WantCompare: gedcom.IndividualComparisons{
@@ -132,8 +132,8 @@ var individualNodesTests = map[string]struct {
 		},
 	},
 	"NoMatches": {
-		Doc1: gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot, jane}),
-		Doc2: gedcom.NewDocumentWithNodes(gedcom.Nodes{bob, john}),
+		Doc1:                      gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot, jane}),
+		Doc2:                      gedcom.NewDocumentWithNodes(gedcom.Nodes{bob, john}),
 		MinimumWeightedSimilarity: 0.9,
 		PreferPointerAbove:        1.0,
 		WantCompare: gedcom.IndividualComparisons{
@@ -152,8 +152,8 @@ var individualNodesTests = map[string]struct {
 	"AlwaysUsePointer": {
 		// John and Jane are both P2. Even though they are completely different
 		// we force pointers to match with a prefer value of 0.0.
-		Doc1: gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot, jane}),
-		Doc2: gedcom.NewDocumentWithNodes(gedcom.Nodes{bob, john}),
+		Doc1:                      gedcom.NewDocumentWithNodes(gedcom.Nodes{elliot, jane}),
+		Doc2:                      gedcom.NewDocumentWithNodes(gedcom.Nodes{bob, john}),
 		MinimumWeightedSimilarity: 0.9,
 		PreferPointerAbove:        0.0,
 		WantCompare: gedcom.IndividualComparisons{