From 33cac13c39c6d88d81568e76cd5f94842fd39193 Mon Sep 17 00:00:00 2001 From: Frits van Bommel Date: Sun, 13 Sep 2020 17:15:55 +0200 Subject: [PATCH 1/2] Migrate to new sortorder import path See fvbommel/util#7 --- go.mod | 3 +-- go.sum | 6 ++---- pkg/lib/certifications/versions/1_0_0/certification.go | 2 +- pkg/lib/common/verifications.go | 2 +- pkg/lib/components.go | 2 +- pkg/lib/standards/versions/1_0_0/standard.go | 2 +- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 21a8ec17..a192948d 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/blang/semver v1.1.1-0.20200524153540-4487282d7812 github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/set v0.2.1 + github.com/fvbommel/sortorder v1.0.1 github.com/onsi/ginkgo v1.14.1-0.20200812193004-f49cf5da3a2f github.com/onsi/gomega v1.10.2-0.20200811195334-990941a380b2 github.com/spf13/cobra v1.0.1-0.20200823174541-9ed1d713d619 @@ -14,10 +15,8 @@ require ( github.com/stretchr/objx v0.1.1 // indirect github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709 github.com/tg/gosortmap v0.0.0-20190425101757-4b9ddc7c3a61 - github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1 // indirect golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8 // indirect golang.org/x/text v0.3.4-0.20200821135104-79eda68eebff // indirect gopkg.in/yaml.v2 v2.3.1-0.20200602174213-b893565b90ca - vbom.ml/util v0.0.0-20180919145318-efcd4e0f9787 ) diff --git a/go.sum b/go.sum index f352234b..35368526 100644 --- a/go.sum +++ b/go.sum @@ -11,6 +11,8 @@ github.com/fatih/set v0.2.1/go.mod h1:+RKtMCH+favT2+3YecHGxcc0b4KyVWA1QWWJUs4E0C github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fvbommel/sortorder v1.0.1 h1:dSnXLt4mJYH25uDDGa3biZNQsozaUWDSWeKJ0qqFfzE= +github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -52,8 +54,6 @@ github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709 h1:Ko2LQMrRU+Oy github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/tg/gosortmap v0.0.0-20190425101757-4b9ddc7c3a61 h1:8sTn8YrNeBMbu6nGJLFxA+LqiJ1yPjvLMBHF3aTmMfA= github.com/tg/gosortmap v0.0.0-20190425101757-4b9ddc7c3a61/go.mod h1:zy3H7er7fS3X6u5hRIADO2KrfONyymrSfrge7IPXcCM= -github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1 h1:j2hhcujLRHAg872RWAV5yaUrEjHEObwDv3aImCaNLek= -github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1/go.mod h1:QcJo0QPSfTONNIgpN5RA8prR7fF8nkF6cTWTcNerRO8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -95,5 +95,3 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.1-0.20200602174213-b893565b90ca h1:oivFrl3Vo+KfpUmTDJvz91I+BWzDPOQ+0CNR5jwTHcg= gopkg.in/yaml.v2 v2.3.1-0.20200602174213-b893565b90ca/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -vbom.ml/util v0.0.0-20180919145318-efcd4e0f9787 h1:O69FD9pJA4WUZlEwYatBEEkRWKQ5cKodWpdKTrCS/iQ= -vbom.ml/util v0.0.0-20180919145318-efcd4e0f9787/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj6uzU2+8OWDFv/HxUSs7kI= diff --git a/pkg/lib/certifications/versions/1_0_0/certification.go b/pkg/lib/certifications/versions/1_0_0/certification.go index a3a204bf..5e5faf55 100644 --- a/pkg/lib/certifications/versions/1_0_0/certification.go +++ b/pkg/lib/certifications/versions/1_0_0/certification.go @@ -8,8 +8,8 @@ import ( "bytes" "encoding/json" "fmt" + "github.com/fvbommel/sortorder" "sort" - "vbom.ml/util/sortorder" ) // Certification struct is a collection of specific standards and controls diff --git a/pkg/lib/common/verifications.go b/pkg/lib/common/verifications.go index c656f2b3..310cc3aa 100644 --- a/pkg/lib/common/verifications.go +++ b/pkg/lib/common/verifications.go @@ -5,7 +5,7 @@ package common import ( - "vbom.ml/util/sortorder" + "github.com/fvbommel/sortorder" ) // Verification struct holds data for a specific component and verification diff --git a/pkg/lib/components.go b/pkg/lib/components.go index 04a0f788..db27ad21 100644 --- a/pkg/lib/components.go +++ b/pkg/lib/components.go @@ -8,8 +8,8 @@ import ( "sync" "fmt" + "github.com/fvbommel/sortorder" "sort" - "vbom.ml/util/sortorder" "github.com/opencontrol/compliance-masonry/pkg/lib/common" "github.com/opencontrol/compliance-masonry/pkg/lib/components" diff --git a/pkg/lib/standards/versions/1_0_0/standard.go b/pkg/lib/standards/versions/1_0_0/standard.go index 2f43d78b..4f01a045 100644 --- a/pkg/lib/standards/versions/1_0_0/standard.go +++ b/pkg/lib/standards/versions/1_0_0/standard.go @@ -7,8 +7,8 @@ package standard import ( "sort" + "github.com/fvbommel/sortorder" "github.com/opencontrol/compliance-masonry/pkg/lib/common" - "vbom.ml/util/sortorder" ) // Control struct stores data on a specific security requirement From f3671cd487f680c334e61b18dfe491307cf52dd5 Mon Sep 17 00:00:00 2001 From: Frits van Bommel Date: Sun, 13 Sep 2020 17:19:01 +0200 Subject: [PATCH 2/2] go mod vendor --- .../github.com/fvbommel/sortorder/.gitignore | 19 +++++++++++++++++++ .../fvbommel/sortorder}/LICENSE | 0 .../github.com/fvbommel/sortorder/README.md | 5 +++++ .../fvbommel}/sortorder/doc.go | 2 +- vendor/github.com/fvbommel/sortorder/go.mod | 3 +++ vendor/github.com/fvbommel/sortorder/go.sum | 0 .../fvbommel}/sortorder/natsort.go | 0 vendor/modules.txt | 8 +++----- vendor/vbom.ml/util/sortorder/README.md | 5 ----- 9 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 vendor/github.com/fvbommel/sortorder/.gitignore rename vendor/{vbom.ml/util => github.com/fvbommel/sortorder}/LICENSE (100%) create mode 100644 vendor/github.com/fvbommel/sortorder/README.md rename vendor/{vbom.ml/util => github.com/fvbommel}/sortorder/doc.go (78%) create mode 100644 vendor/github.com/fvbommel/sortorder/go.mod create mode 100644 vendor/github.com/fvbommel/sortorder/go.sum rename vendor/{vbom.ml/util => github.com/fvbommel}/sortorder/natsort.go (100%) delete mode 100644 vendor/vbom.ml/util/sortorder/README.md diff --git a/vendor/github.com/fvbommel/sortorder/.gitignore b/vendor/github.com/fvbommel/sortorder/.gitignore new file mode 100644 index 00000000..c021733e --- /dev/null +++ b/vendor/github.com/fvbommel/sortorder/.gitignore @@ -0,0 +1,19 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so +# Folders +_obj +_test +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* +_testmain.go +*.exe +*.test +*.prof diff --git a/vendor/vbom.ml/util/LICENSE b/vendor/github.com/fvbommel/sortorder/LICENSE similarity index 100% rename from vendor/vbom.ml/util/LICENSE rename to vendor/github.com/fvbommel/sortorder/LICENSE diff --git a/vendor/github.com/fvbommel/sortorder/README.md b/vendor/github.com/fvbommel/sortorder/README.md new file mode 100644 index 00000000..7ebcab1d --- /dev/null +++ b/vendor/github.com/fvbommel/sortorder/README.md @@ -0,0 +1,5 @@ +# sortorder [![PkgGoDev](https://pkg.go.dev/badge/github.com/fvbommel/sortorder)](https://pkg.go.dev/github.com/fvbommel/sortorder) + + import "github.com/fvbommel/sortorder" + +Sort orders and comparison functions. diff --git a/vendor/vbom.ml/util/sortorder/doc.go b/vendor/github.com/fvbommel/sortorder/doc.go similarity index 78% rename from vendor/vbom.ml/util/sortorder/doc.go rename to vendor/github.com/fvbommel/sortorder/doc.go index 61b37a93..75d5a292 100644 --- a/vendor/vbom.ml/util/sortorder/doc.go +++ b/vendor/github.com/fvbommel/sortorder/doc.go @@ -2,4 +2,4 @@ // // Currently, it only implements so-called "natural order", where integers // embedded in strings are compared by value. -package sortorder // import "vbom.ml/util/sortorder" +package sortorder diff --git a/vendor/github.com/fvbommel/sortorder/go.mod b/vendor/github.com/fvbommel/sortorder/go.mod new file mode 100644 index 00000000..57c8175e --- /dev/null +++ b/vendor/github.com/fvbommel/sortorder/go.mod @@ -0,0 +1,3 @@ +module github.com/fvbommel/sortorder + +go 1.13 diff --git a/vendor/github.com/fvbommel/sortorder/go.sum b/vendor/github.com/fvbommel/sortorder/go.sum new file mode 100644 index 00000000..e69de29b diff --git a/vendor/vbom.ml/util/sortorder/natsort.go b/vendor/github.com/fvbommel/sortorder/natsort.go similarity index 100% rename from vendor/vbom.ml/util/sortorder/natsort.go rename to vendor/github.com/fvbommel/sortorder/natsort.go diff --git a/vendor/modules.txt b/vendor/modules.txt index cc49f6f6..442c912d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -12,6 +12,9 @@ github.com/davecgh/go-spew/spew github.com/fatih/set # github.com/fsnotify/fsnotify v1.4.9 github.com/fsnotify/fsnotify +# github.com/fvbommel/sortorder v1.0.1 +## explicit +github.com/fvbommel/sortorder # github.com/inconshreveable/mousetrap v1.0.0 github.com/inconshreveable/mousetrap # github.com/nxadm/tail v1.4.4 @@ -76,8 +79,6 @@ github.com/stretchr/testify/mock # github.com/tg/gosortmap v0.0.0-20190425101757-4b9ddc7c3a61 ## explicit github.com/tg/gosortmap -# github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1 -## explicit # golang.org/x/net v0.0.0-20200822124328-c89045814202 ## explicit golang.org/x/net/html @@ -114,6 +115,3 @@ gopkg.in/tomb.v1 # gopkg.in/yaml.v2 v2.3.1-0.20200602174213-b893565b90ca ## explicit gopkg.in/yaml.v2 -# vbom.ml/util v0.0.0-20180919145318-efcd4e0f9787 -## explicit -vbom.ml/util/sortorder diff --git a/vendor/vbom.ml/util/sortorder/README.md b/vendor/vbom.ml/util/sortorder/README.md deleted file mode 100644 index ed8da0e2..00000000 --- a/vendor/vbom.ml/util/sortorder/README.md +++ /dev/null @@ -1,5 +0,0 @@ -## sortorder [![GoDoc](https://godoc.org/vbom.ml/util/sortorder?status.svg)](https://godoc.org/vbom.ml/util/sortorder) - - import "vbom.ml/util/sortorder" - -Sort orders and comparison functions.