Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace reflect.Typeof.Name with fmt.Sprintf("%T") #10392

Merged
merged 1 commit into from
Oct 18, 2021
Merged

fix: replace reflect.Typeof.Name with fmt.Sprintf("%T") #10392

merged 1 commit into from
Oct 18, 2021

Conversation

odeke-em
Copy link
Collaborator

Per https://golang.org/pkg/fmt#hdr-Printing, Go's fmt "%T" specifier
prints out the underlying type hence we don't need to invoke
reflect.Typeof(key).Name() just to get it. This change was discovered
while examining Informal Systems' static analyzers that want to flag
certain packages.

Fixes #10391

@codecov
Copy link

codecov bot commented Oct 18, 2021

Codecov Report

Merging #10392 (5e9ea59) into master (c0cc052) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10392      +/-   ##
==========================================
- Coverage   64.28%   64.27%   -0.01%     
==========================================
  Files         572      572              
  Lines       54230    54230              
==========================================
- Hits        34862    34858       -4     
- Misses      17387    17390       +3     
- Partials     1981     1982       +1     
Impacted Files Coverage Δ
baseapp/baseapp.go 67.11% <0.00%> (ø)
crypto/keys/internal/ecdsa/privkey.go 82.45% <0.00%> (-1.76%) ⬇️
x/distribution/simulation/operations.go 90.27% <0.00%> (-1.63%) ⬇️

Per https://golang.org/pkg/fmt#hdr-Printing, Go's fmt "%T" specifier
prints out the underlying type hence we don't need to invoke
reflect.Typeof(key).Name() just to get it. This change was discovered
while examining Informal Systems' static analyzers that want to flag
certain packages.

Fixes #10391
@tac0turtle tac0turtle changed the title baseapp: replace reflect.Typeof.Name with fmt.Sprintf("%T") fix: replace reflect.Typeof.Name with fmt.Sprintf("%T") Oct 18, 2021
@tac0turtle tac0turtle added A:automerge Automatically merge PR once all prerequisites pass. C:baseapp labels Oct 18, 2021
@mergify mergify bot merged commit 7a84040 into cosmos:master Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. C:baseapp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

baseapp: (*BaseApp).MountStores can use fmt.Sprintf("%T", key) instead of reflect.TypeOf(key).Name()
3 participants