Runtime error: invalid memory address or nil pointer dereference #1

Did you add this before the function:

package stringutil

From what I see, this is the full file:

// Package stringutil contains utility functions for working with strings.
package stringutil

// Reverse returns its argument string reversed rune-wise left to right.
func Reverse(s string) string {
	r := []rune(s)
	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}

@radovskyb OH! I see it. I thought that was apart of the multiple line comment, sorry for the stupid question :slight_smile:

attention to detail is very Important!!!

That’s fine :slight_smile:

By the way, for times when I’m not online, it might be better for you to post your questions as new questions on the forum instead of in this same post, since other people are also more likely to help you out as well when they see new questions being posted.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.