Skip to content

Commit

Permalink
patch version of yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
ga-paul-t committed May 26, 2022
1 parent a2b88dc commit ca11b68
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/uplift/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (

"github.com/gembaadvantage/uplift/internal/config"
"github.com/gembaadvantage/uplift/internal/git"
"github.com/go-yaml/yaml"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ require (
github.com/Masterminds/semver v1.5.0
github.com/apex/log v1.9.0
github.com/gembaadvantage/codecommit-sign v1.3.1
github.com/go-yaml/yaml v2.1.0+incompatible
github.com/muesli/mango-cobra v1.1.0
github.com/muesli/roff v0.1.0
github.com/spf13/cobra v1.4.0
github.com/stretchr/testify v1.7.1
github.com/tidwall/gjson v1.14.1
github.com/tidwall/sjson v1.2.4
gopkg.in/yaml.v3 v3.0.0
mvdan.cc/sh/v3 v3.5.1
)

Expand All @@ -32,5 +32,4 @@ require (
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
7 changes: 2 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo
github.com/gembaadvantage/codecommit-sign v1.3.1 h1:eeQMD2r5ygKA8wBzqVTARAh2Lo3TaPLglTb+VjMe8Rs=
github.com/gembaadvantage/codecommit-sign v1.3.1/go.mod h1:fEF012IUbRKrjbw1fd5EHczv1x4rLy1ZAN0EDZ4IO2o=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o=
github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
Expand Down Expand Up @@ -125,11 +123,10 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
mvdan.cc/sh/v3 v3.5.1 h1:hmP3UOw4f+EYexsJjFxvU38+kn+V/s2CclXHanIBkmQ=
mvdan.cc/sh/v3 v3.5.1/go.mod h1:1JcoyAKm1lZw/2bZje/iYKWicU/KMd0rsyJeKHnsK4E=
9 changes: 7 additions & 2 deletions internal/config/uplift.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ SOFTWARE.
package config

import (
"bytes"
"io/ioutil"
"os"

"github.com/go-yaml/yaml"
"gopkg.in/yaml.v3"
)

// Uplift defines the root configuration of the application
Expand Down Expand Up @@ -130,7 +131,11 @@ func Load(f string) (Uplift, error) {
return Uplift{}, err
}

decoder := yaml.NewDecoder(bytes.NewReader(data))
decoder.KnownFields(true)

var cfg Uplift
err = yaml.UnmarshalStrict(data, &cfg)
err = decoder.Decode(&cfg)

return cfg, err
}

0 comments on commit ca11b68

Please sign in to comment.