github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/blog/content/slices/prog050.go (about) 1 // +build OMIT 2 3 // Copyright 2013 The Go Authors. All rights reserved. 4 // Use of this source code is governed by a BSD-style 5 // license that can be found in the LICENSE file. 6 7 package main 8 9 import ( 10 "fmt" 11 ) 12 13 type path []byte 14 15 func (p path) ToUpper() { 16 for i, b := range p { 17 if 'a' <= b && b <= 'z' { 18 p[i] = b + 'A' - 'a' 19 } 20 } 21 } 22 23 func main() { 24 pathName := path("/usr/bin/tso") 25 pathName.ToUpper() 26 fmt.Printf("%s\n", pathName) 27 }