Attempt at modules support.

This commit is contained in:
udhos 2019-04-08 12:43:12 -03:00
parent 5a7bb23018
commit 335b1f1a3d
7 changed files with 15 additions and 9 deletions

View File

@ -4,7 +4,7 @@ import (
"fmt"
"strconv"
yaml "gopkg.in/mikefarah/yaml.v2"
yaml "github.com/mikefarah/yaml"
)
func entryInSlice(context yaml.MapSlice, key interface{}) *yaml.MapItem {

View File

@ -5,7 +5,7 @@ import (
"sort"
"testing"
yaml "gopkg.in/mikefarah/yaml.v2"
yaml "github.com/mikefarah/yaml"
)
func TestReadMap_simple(t *testing.T) {

11
go.mod
View File

@ -2,14 +2,17 @@ module github.com/mikefarah/yq
go 1.12
//replace gopkg.in/mikefarah/yaml.v2 => ../yaml
//uncomment for local testing:
//replace github.com/mikefarah/yaml => ../yaml
//uncomment for testing with github.com/udhos/yaml:
//replace github.com/mikefarah/yaml => github.com/udhos/yaml v0.0.0-20190408152634-649037afe55b
require (
github.com/inconshreveable/mousetrap v1.0.0
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/pkg/errors v0.0.0-20180311214515-816c9085562c
github.com/spf13/pflag v0.0.0-20180601132542-3ebe029320b2
github.com/spf13/pflag v0.0.0-20180601132542-3ebe029320b2 // indirect
gopkg.in/imdario/mergo.v0 v0.3.5
gopkg.in/mikefarah/yaml.v2 v2.3.0
gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473
gopkg.in/spf13/cobra.v0 v0.0.3
)

3
go.sum
View File

@ -1,8 +1,10 @@
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/pkg/errors v0.0.0-20180311214515-816c9085562c h1:F5RoIh7F9wB47PvXvpP1+Ihq1TkyC8iRdvwfKkESEZQ=
github.com/pkg/errors v0.0.0-20180311214515-816c9085562c/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/spf13/pflag v0.0.0-20180601132542-3ebe029320b2 h1:OAuq3yHhRwcm/kwCSAqf07pUm/EcLZYNz1ket+Bm0SI=
github.com/spf13/pflag v0.0.0-20180601132542-3ebe029320b2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/imdario/mergo.v0 v0.3.5 h1:6zCW0jXZVCCwo8R3Eluvn0KrFnr9xHtIAzuY6liXhnQ=
gopkg.in/imdario/mergo.v0 v0.3.5/go.mod h1:9qPP6AGrlC1G2PTNXko614FwGZvorN7MiBU0Eppok+U=
@ -10,4 +12,5 @@ gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 h1:6D+BvnJ/j6e222UW
gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473/go.mod h1:N1eN2tsCx0Ydtgjl4cqmbRCsY4/+z4cYDeqwZTk6zog=
gopkg.in/spf13/cobra.v0 v0.0.3 h1:4c7bx2ptqKWgvtpMlxQ3+Sz2TGQJRFta6NPbsBoPWiI=
gopkg.in/spf13/cobra.v0 v0.0.3/go.mod h1:0uH3dBExZsLMtmAYkOADzQjN8NgzRpuVELthkMsoEKs=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

View File

@ -5,7 +5,7 @@ import (
"fmt"
"strconv"
yaml "gopkg.in/mikefarah/yaml.v2"
yaml "github.com/mikefarah/yaml"
)
func jsonToString(context interface{}) (string, error) {

View File

@ -9,7 +9,7 @@ import (
"strings"
"testing"
yaml "gopkg.in/mikefarah/yaml.v2"
yaml "github.com/mikefarah/yaml"
cobra "gopkg.in/spf13/cobra.v0"
)

2
yq.go
View File

@ -12,7 +12,7 @@ import (
errors "github.com/pkg/errors"
yaml "gopkg.in/mikefarah/yaml.v2"
yaml "github.com/mikefarah/yaml"
logging "gopkg.in/op/go-logging.v1"
cobra "gopkg.in/spf13/cobra.v0"
)