From a0877d4e793ef46f12cac4239f873e34abaf4c0f Mon Sep 17 00:00:00 2001 From: Paul Lhussiez Date: Thu, 2 Feb 2023 11:02:03 +0100 Subject: [PATCH] fix(deps): upgrade to yaml.v3 --- cmd/new.go | 4 ++-- go.mod | 4 ++-- models/metadata.go | 2 +- models/pages.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/new.go b/cmd/new.go index b7f41dc..28ffe5e 100644 --- a/cmd/new.go +++ b/cmd/new.go @@ -10,7 +10,7 @@ import ( "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/viper" - yaml "gopkg.in/yaml.v2" + yaml "gopkg.in/yaml.v3" "github.com/Depado/smallblog/models" ) @@ -19,7 +19,7 @@ import ( func AddNewCommand(c *cobra.Command) error { var err error - var helpmsg = `Generate a new article. The first argument is the filename of the + var helpmsg = `Generate a new article. The first argument is the filename of the article created and should not exist in the configured pages directory. If the title isn't provided with the appropriate --title flag, it should be added by hand in the generated file.` diff --git a/go.mod b/go.mod index d29cb25..a70a4ee 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/spf13/cobra v1.6.1 github.com/spf13/viper v1.15.0 github.com/stvp/slug v0.0.0-20150928221549-5ab8191bb1fe - gopkg.in/yaml.v2 v2.4.0 + gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -50,5 +50,5 @@ require ( golang.org/x/text v0.6.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/models/metadata.go b/models/metadata.go index 9bdd59d..83b5c49 100644 --- a/models/metadata.go +++ b/models/metadata.go @@ -18,7 +18,7 @@ type MetaData struct { Draft bool `yaml:"draft"` } -// Validate validates that the metada is valid +// Validate validates that the metadata is valid func (m *MetaData) Validate() error { if m.Date == "" { return fmt.Errorf("parser: The `date` field is mandatory") diff --git a/models/pages.go b/models/pages.go index 35acf40..15aa8ad 100644 --- a/models/pages.go +++ b/models/pages.go @@ -14,7 +14,7 @@ import ( "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/spf13/viper" - "gopkg.in/yaml.v2" + "gopkg.in/yaml.v3" ) // MPages is the map containing all the articles. The key is the slug of the article