From here http://blog.golang.org/slices (it's right before the Capacity section)
type path []byte
func (p path) ToUpper() {
for i, b := range p {
if 'a' <= b && b <= 'z' {
p[i] = b + 'A' - 'a'
}
}
}
func main() {
pathName := path("/usr/bin/tso")
pathName.ToUpper()
string1 := string(pathName)
fmt.Printf("%s
", string1)
}
Was reading on slices and stuff in golang. This is a function to convert ascii characters. How would you go about turning this function to handle unicode as well?