Post

Go rune type

Go rune type

1
2
3
4
5
6
7
8
9
10
11
12
13
14
func arrays()  {
	// !!! if declating string -> use double quotes ""
	s := "this is a string"
	b := []byte(s)
	fmt.Printf("%v, %T\n", b, b)

	// !!! rune <- this is a type and it is represented as int32
	// "rune" is a type alias for "int32"
	r := 'a'
	var x rune = 'a'

	fmt.Printf("%v, %T", r, r)
	fmt.Printf("%v, %T", x, x)
}
This post is licensed under CC BY 4.0 by the author.