Skip to content

Commit 662e8e9

Browse files
nit: fix code comment in binarytodecimal.go and in decimaltobinary.go (#733)
1 parent d7470ba commit 662e8e9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
229229

230230
1. [`Base64Decode`](./conversion/base64.go#L57): Base64Decode decodes the received input base64 string into a byte slice. The implementation follows the RFC4648 standard, which is documented at https://datatracker.ietf.org/doc/html/rfc4648#section-4
231231
2. [`Base64Encode`](./conversion/base64.go#L19): Base64Encode encodes the received input bytes slice into a base64 string. The implementation follows the RFC4648 standard, which is documented at https://datatracker.ietf.org/doc/html/rfc4648#section-4
232-
3. [`BinaryToDecimal`](./conversion/binarytodecimal.go#L25): BinaryToDecimal() function that will take Binary number as string, and return it's Decimal equivalent as integer.
233-
4. [`DecimalToBinary`](./conversion/decimaltobinary.go#L32): DecimalToBinary() function that will take Decimal number as int, and return it's Binary equivalent as string.
232+
3. [`BinaryToDecimal`](./conversion/binarytodecimal.go#L25): BinaryToDecimal() function that will take Binary number as string, and return its Decimal equivalent as integer.
233+
4. [`DecimalToBinary`](./conversion/decimaltobinary.go#L32): DecimalToBinary() function that will take Decimal number as int, and return its Binary equivalent as string.
234234
5. [`FuzzBase64Encode`](./conversion/base64_test.go#L113): No description provided.
235235
6. [`HEXToRGB`](./conversion/rgbhex.go#L10): HEXToRGB splits an RGB input (e.g. a color in hex format; 0x<color-code>) into the individual components: red, green and blue
236236
7. [`IntToRoman`](./conversion/inttoroman.go#L17): IntToRoman converts an integer value to a roman numeral string. An error is returned if the integer is not between 1 and 3999.

conversion/binarytodecimal.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
var isValid = regexp.MustCompile("^[0-1]{1,}$").MatchString
2222

2323
// BinaryToDecimal() function that will take Binary number as string,
24-
// and return it's Decimal equivalent as integer.
24+
// and return its Decimal equivalent as an integer.
2525
func BinaryToDecimal(binary string) (int, error) {
2626
if !isValid(binary) {
2727
return -1, errors.New("not a valid binary string")

conversion/decimaltobinary.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func Reverse(str string) string {
2828
}
2929

3030
// DecimalToBinary() function that will take Decimal number as int,
31-
// and return it's Binary equivalent as string.
31+
// and return its Binary equivalent as a string.
3232
func DecimalToBinary(num int) (string, error) {
3333
if num < 0 {
3434
return "", errors.New("integer must have +ve value")

0 commit comments

Comments
 (0)