Use tabs as the canonical source indentation in git
Space conversion is done during generation only. Fixes #192
This commit is contained in:
committed by
Mark McGranaghan
parent
1699ad1c45
commit
7c160440be
@@ -12,7 +12,7 @@ import "fmt"
|
||||
// value. `zeroval` will get a copy of `ival` distinct
|
||||
// from the one in the calling function.
|
||||
func zeroval(ival int) {
|
||||
ival = 0
|
||||
ival = 0
|
||||
}
|
||||
|
||||
// `zeroptr` in contrast has an `*int` parameter, meaning
|
||||
@@ -22,21 +22,21 @@ func zeroval(ival int) {
|
||||
// Assigning a value to a dereferenced pointer changes the
|
||||
// value at the referenced address.
|
||||
func zeroptr(iptr *int) {
|
||||
*iptr = 0
|
||||
*iptr = 0
|
||||
}
|
||||
|
||||
func main() {
|
||||
i := 1
|
||||
fmt.Println("initial:", i)
|
||||
i := 1
|
||||
fmt.Println("initial:", i)
|
||||
|
||||
zeroval(i)
|
||||
fmt.Println("zeroval:", i)
|
||||
zeroval(i)
|
||||
fmt.Println("zeroval:", i)
|
||||
|
||||
// The `&i` syntax gives the memory address of `i`,
|
||||
// i.e. a pointer to `i`.
|
||||
zeroptr(&i)
|
||||
fmt.Println("zeroptr:", i)
|
||||
// The `&i` syntax gives the memory address of `i`,
|
||||
// i.e. a pointer to `i`.
|
||||
zeroptr(&i)
|
||||
fmt.Println("zeroptr:", i)
|
||||
|
||||
// Pointers can be printed too.
|
||||
fmt.Println("pointer:", &i)
|
||||
// Pointers can be printed too.
|
||||
fmt.Println("pointer:", &i)
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
85cff3345d2f22b65a5d54eb8f7aa8f508f27887
|
||||
KdE4TBbUL2
|
||||
fnQkHp4hriG
|
||||
|
||||
Reference in New Issue
Block a user