Files
learning-go-jon-bodner/chapter-2/05_naming_variables_constants.go
2022-12-03 18:29:02 +00:00

31 lines
727 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// any unicode letter/number is valid for names in go - don't use them
// snake_case is rarely used, use camelCase
// prefer shorter names, k,v for key,value in for loops etc
// if using single letter var names, you can follow the type. E.g i for int, b for bool
// when naming vars/consts in the package level, favour more descriptive names
// !!! the smaller the scope of the variable, the shorter the name !!!
package main
import "fmt"
func main() {
_0 := 0_0
_ᔜ := 20
π := 3
:= "hello" // Unicode U+FF41
fmt.Println(_0)
fmt.Println(_ᔜ)
fmt.Println(π)
fmt.Println()
= "hello" // Unicode U+FF41
a := "goodbye" // standard lowercase a (Unicode U+0061)
fmt.Println()
fmt.Println(a)
}