index work
This commit is contained in:
parent
1c63eb272c
commit
434392e67c
@ -1,12 +0,0 @@
|
||||
// ## Recover
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
defer func() {
|
||||
fmt.Println("Preparing for trouble...\n")
|
||||
}()
|
||||
panic("Trouble!")
|
||||
}
|
@ -20,3 +20,5 @@ func main() {
|
||||
cOrdered := Circle{1, 2, 5}
|
||||
fmt.Println(cOrdered)
|
||||
}
|
||||
|
||||
// todo: add field access
|
@ -1,17 +0,0 @@
|
||||
// ## Struct Fields
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
type Circle struct {
|
||||
x, y, r int
|
||||
}
|
||||
|
||||
func main() {
|
||||
c := Circle{x: 1, y: 2, r: 5}
|
||||
fmt.Println(c.x, c.y, c.r)
|
||||
c.x = 10
|
||||
c.y = 5
|
||||
fmt.Println(c.x, c.y, c.r)
|
||||
}
|
@ -18,3 +18,5 @@ func main() {
|
||||
fmt.Println(name)
|
||||
}
|
||||
}
|
||||
|
||||
// todo: note about use with errors
|
@ -22,16 +22,14 @@ closures
|
||||
recursion
|
||||
defer
|
||||
panic
|
||||
recover
|
||||
pointers
|
||||
new
|
||||
structs
|
||||
struct-fields
|
||||
methods
|
||||
embedding
|
||||
interfaces
|
||||
ok-guards
|
||||
errors
|
||||
ok-guards
|
||||
~ comments
|
||||
|
||||
# concurrency
|
||||
|
Loading…
x
Reference in New Issue
Block a user