Skip to content

Commit

Permalink
refactor(version): skip extra info if empty (#18438)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Nov 10, 2023
1 parent 04d5fc3 commit 79c6418
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions version/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ func NewVersionCommand() *cobra.Command {
}

// Extract and set extra information from the context
extraInfo := extraInfoFromContext(cmd)
verInfo.ExtraInfo = &extraInfo
verInfo.ExtraInfo = extraInfoFromContext(cmd)

var (
bz []byte
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type Info struct {
GoVersion string `json:"go" yaml:"go"`
BuildDeps []buildDep `json:"build_deps" yaml:"build_deps"`
CosmosSdkVersion string `json:"cosmos_sdk_version" yaml:"cosmos_sdk_version"`
ExtraInfo *ExtraInfo `json:"extra_info" yaml:"extra_info"`
ExtraInfo ExtraInfo `json:"extra_info,omitempty" yaml:"extra_info,omitempty"`
}

func NewInfo() Info {
Expand Down

0 comments on commit 79c6418

Please sign in to comment.