Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry-Sarabia committed Feb 15, 2019
1 parent ecd08b7 commit 0ae98be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sliceconv.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"strconv"
)

// Itoa converts the provided integers into their respective string representations
// in base 10.
func Itoa(ints ...int) []string {
var str []string
for _, i := range ints {
Expand All @@ -13,6 +15,8 @@ func Itoa(ints ...int) []string {
return str
}

// Atoi converts the provided strings into their respective base 10 integer
// representations. If any of the strings are not valid digits, an error is returned.
func Atoi(str ...string) ([]int, error) {
var ints []int
for _, s := range str {
Expand Down

0 comments on commit 0ae98be

Please sign in to comment.