From e4cd6b572218b5333cd84a7155ebd97a0b09c234 Mon Sep 17 00:00:00 2001 From: Xuing Date: Thu, 9 Mar 2023 15:19:01 +0800 Subject: [PATCH] Unified gopkg.in/yaml version to v2 (#5169) * Unified gopkg.in/yaml version to v2 and go mod tidy * update CHANGELOG --- CHANGELOG.md | 1 + client/httplib/httplib.go | 2 +- core/config/yaml/yaml.go | 2 +- go.mod | 3 +-- go.sum | 1 + server/web/context/output.go | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99a7b61a..f4775697 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # developing +- [unified gopkg.in/yaml version to v2](https://github.com/beego/beego/pull/5169) - [add non-block write log in asynchronous mode](https://github.com/beego/beego/pull/5150) - [Fix 5126: support bloom filter cache](https://github.com/beego/beego/pull/5126) - [Fix 5117: support write though cache](https://github.com/beego/beego/pull/5117) diff --git a/client/httplib/httplib.go b/client/httplib/httplib.go index dcd40293..304c5909 100644 --- a/client/httplib/httplib.go +++ b/client/httplib/httplib.go @@ -48,7 +48,7 @@ import ( "strings" "time" - "gopkg.in/yaml.v2" + "gopkg.in/yaml.v3" "github.com/beego/beego/v2/core/berror" "github.com/beego/beego/v2/core/logs" diff --git a/core/config/yaml/yaml.go b/core/config/yaml/yaml.go index 4258398d..b18ce06b 100644 --- a/core/config/yaml/yaml.go +++ b/core/config/yaml/yaml.go @@ -31,7 +31,7 @@ import ( "strings" "sync" - "gopkg.in/yaml.v2" + "gopkg.in/yaml.v3" "github.com/beego/beego/v2/core/config" "github.com/beego/beego/v2/core/logs" diff --git a/go.mod b/go.mod index 5c8eb76e..37d3f150 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.18 require ( github.com/beego/x2j v0.0.0-20131220205130-a0352aadc542 + github.com/bits-and-blooms/bloom/v3 v3.3.1 github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b github.com/casbin/casbin v1.9.1 github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 @@ -38,7 +39,6 @@ require ( golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f google.golang.org/grpc v1.40.0 google.golang.org/protobuf v1.28.1 - gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -46,7 +46,6 @@ require ( github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.4.0 // indirect - github.com/bits-and-blooms/bloom/v3 v3.3.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd/v22 v22.3.2 // indirect diff --git a/go.sum b/go.sum index a15fe700..d3a2a3d2 100644 --- a/go.sum +++ b/go.sum @@ -321,6 +321,7 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112 h1:NBrpnvz0pDPf3+HXZ1C9GcJd1DTpWDLcLWZhNq6uP7o= github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= +github.com/twmb/murmur3 v1.1.6 h1:mqrRot1BRxm+Yct+vavLMou2/iJt0tNVTTC0QoIjaZg= github.com/twmb/murmur3 v1.1.6/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/server/web/context/output.go b/server/web/context/output.go index f52eac9d..b09c792b 100644 --- a/server/web/context/output.go +++ b/server/web/context/output.go @@ -32,7 +32,7 @@ import ( "time" "google.golang.org/protobuf/proto" - "gopkg.in/yaml.v2" + "gopkg.in/yaml.v3" ) // BeegoOutput does work for sending response header.