From eeebedab5bc4d0526306d8548a34400c1c4824fa Mon Sep 17 00:00:00 2001 From: George Brighton Date: Sat, 28 May 2022 20:21:12 +0100 Subject: [PATCH] Upgrade to go-yaml v3 --- go.mod | 2 +- go.sum | 4 ++-- session/file/provider.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 3940864..e505d48 100644 --- a/go.mod +++ b/go.mod @@ -8,5 +8,5 @@ require ( github.com/gebn/go-stamp/v2 v2.2.1 github.com/prometheus/client_golang v1.12.2 go.uber.org/automaxprocs v1.5.1 - gopkg.in/yaml.v2 v2.4.0 + gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index 34278e9..d29bc2a 100644 --- a/go.sum +++ b/go.sum @@ -491,11 +491,11 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/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-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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/session/file/provider.go b/session/file/provider.go index 47e7c42..ab6f4ed 100644 --- a/session/file/provider.go +++ b/session/file/provider.go @@ -13,7 +13,7 @@ import ( "github.com/gebn/bmc_exporter/session" - "gopkg.in/yaml.v2" + "gopkg.in/yaml.v3" ) // Credentials represents the username and password for a single target in a @@ -46,7 +46,7 @@ func New(path string) (*Provider, error) { defer f.Close() d := yaml.NewDecoder(f) - d.SetStrict(true) + d.KnownFields(true) m := map[string]Credentials{} if err := d.Decode(&m); err != nil { return nil, err