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

address a few compiler warnings #175

Merged
merged 2 commits into from
Mar 17, 2021
Merged

address a few compiler warnings #175

merged 2 commits into from
Mar 17, 2021

Conversation

fernomac
Copy link
Contributor

Description of changes:

Hey friends! I was testing out the setup of a new laptop by giving this a build and figured I'd fix a couple quick compiler warnings while I was in the neighborhood:

  • Allocating an empty slice and then appending to it -> directly allocating the resulting slice
  • switch in.(type) -> switch in := in.(type) to avoid a second typecheck/cast in the case statements
  • casting an int to a string is discouraged because what it actually does is string([]rune{rune(int)), but it looks like it's doing strconv.Itoa(int) (we had one of each :)).

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

ion/skipper.go Outdated Show resolved Hide resolved
@codecov-io
Copy link

Codecov Report

Merging #175 (e80b07b) into master (84f0098) will decrease coverage by 0.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #175      +/-   ##
==========================================
- Coverage   74.68%   74.67%   -0.02%     
==========================================
  Files          25       25              
  Lines        4930     4928       -2     
==========================================
- Hits         3682     3680       -2     
  Misses        743      743              
  Partials      505      505              
Impacted Files Coverage Δ
ion/skipper.go 60.37% <0.00%> (ø)
ion/binarywriter.go 75.59% <100.00%> (-0.17%) ⬇️
ion/marshal.go 71.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 84f0098...e80b07b. Read the comment docs.

Copy link
Contributor

@jobarr-amzn jobarr-amzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me :)

@jobarr-amzn jobarr-amzn merged commit 4e5ade8 into amazon-ion:master Mar 17, 2021
@fernomac fernomac deleted the compiler-warnings branch March 17, 2021 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants