From 28c37ed426b256e2d84b3bb4e39160cb722b7124 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Thu, 11 May 2023 23:06:06 +0200 Subject: [PATCH] chore: remove double registration warning (#67) --- CHANGELOG.md | 4 ++++ proto/properties.go | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a20212b1..4602059a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +## [v1.4.10](https://github.com/cosmos/gogoproto/releases/tag/v1.4.10) - 2023-05-11 + +- [#67](https://github.com/cosmos/gogoproto/pull/67) Remove warning about double registration. The Cosmos SDK does purposely double-registration so this warning is not useful. + ## [v1.4.9](https://github.com/cosmos/gogoproto/releases/tag/v1.4.9) - 2023-05-03 ### Breaking changes diff --git a/proto/properties.go b/proto/properties.go index 10cd830e..d7be55a2 100644 --- a/proto/properties.go +++ b/proto/properties.go @@ -651,13 +651,12 @@ func RegisterFile(filename string, fileDescriptor []byte) { // only register files if they are registered the first time // this isn't ideal, but it's needed to make tests pass and some legacy // code bases may have this issue, and we don't want to fail them here + // when the file is already registered, no warning is displayed. if _, err := gogoProtoRegistry.FindFileByPath(file.Path()); err != nil { err = gogoProtoRegistry.RegisterFile(file) if err != nil { panic(err) } - } else { - fmt.Printf("WARNING: proto: file %q already registered\n", file.Path()) } }