Skip to content

hello/reverse: add Int example and its test - #83

Closed
kikazohub wants to merge 1 commit into
golang:masterfrom
kikazohub:int-reverse
Closed

kikazohub wants to merge 1 commit into
golang:masterfrom
kikazohub:int-reverse

Conversation

@kikazohub

Copy link
Copy Markdown

This change adds Int to the hello/reverse package, a companion to the
existing String example.

reverse.Int(123)  // 321
reverse.Int(-123) // -321
reverse.Int(100)  // 1

It includes int.go with the implementation (sign-preserving) and
int_test.go with a table-driven test mirroring the style of
reverse_test.go.

CC @golang/tools

Int returns the decimal representation of an integer with its
digits reversed, preserving the sign. Includes a table-driven test
covering positive, negative and zero inputs.
@google-cla

google-cla Bot commented Sep 21, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@kikazohub kikazohub closed this Sep 21, 2026
@kikazohub
kikazohub deleted the int-reverse branch September 21, 2026 19:59
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.

1 participant