shad-go/lectures/01-basics/scope/scope.go

13 lines
174 B
Go
Raw Normal View History

2020-02-20 14:40:51 +00:00
package main
import "fmt"
2020-02-20 14:51:43 +00:00
//nolint
2020-02-20 14:40:51 +00:00
func main() {
x := "hello"
for _, x := range x {
x := x + 'A' - 'a'
fmt.Printf("%c", x) // "HELLO" (one letter per iteration)
}
}