diff --git a/examples/images/kubi.png b/examples/images/kubi.png new file mode 100644 index 0000000..c457782 Binary files /dev/null and b/examples/images/kubi.png differ diff --git a/go-training.slide b/go-training.slide index d9f96d3..add9513 100644 --- a/go-training.slide +++ b/go-training.slide @@ -13,7 +13,7 @@ https://www.linkedin.com/in/patrick-akil-721b07105/ #---------------------------------------------- -* About me +* About Patrick .image examples/images/microphone.JPG 305 456 - Fitness, Podcasting, Content creation @@ -22,6 +22,19 @@ https://www.linkedin.com/in/patrick-akil-721b07105/ - Running golang in production @Wavin, @Action, @Duxxie & more! #---------------------------------------------- +* About Kubilay + +.image examples/images/kubi.png 317 423 + +- Moved to Netherlands 3 years ago with my wife from Turkey 🇹🇷 +- I like travelling, reading & watching science fiction, history + +- Specialised in backend development, mostly Java & Kotlin and now Golang +- Running golang in production @Action + + +#---------------------------------------------- + * About you - Who are you? @@ -1004,6 +1017,46 @@ TIP: Use a map as in-memory datastore #---------------------------------------------- +* Multi-line defers + + func doit() { + defer func() { + // code to + // cleanup + // resource + // with error-handling an logging + }() + .... + } + +#---------------------------------------------- + +* Cleanup + + func NewGrpcClient(addressPort string) (NotificationClient, func(), error) { + // Prepare connection to the server. + conn, err := grpc.Dial(addressPort, grpc.WithInsecure(), grpc.WithBlock()) + if err != nil { + return nil, nil , fmt.Errorf("Error creating notifapi-grpc-client: %v", err) + } + cleanup := func() { + if conn != nil { + conn.Close() + } + } + return NewNotificationClient(conn), cleanup, nil + } + + func doit() error { + client, cleanup, err := NewGrpcClient(":16123") + if err != nil { + return err + } + defer cleanup() + ..... + +#---------------------------------------------- + * Variadic functions .play -edit examples/variadic/variadic.go @@ -1057,46 +1110,6 @@ Combine with go routines to execute work in background #---------------------------------------------- -* Multi-line defers - - func doit() { - defer func() { - // code to - // cleanup - // resource - // with error-handling an logging - }() - .... - } - -#---------------------------------------------- - -* Cleanup - - func NewGrpcClient(addressPort string) (NotificationClient, func(), error) { - // Prepare connection to the server. - conn, err := grpc.Dial(addressPort, grpc.WithInsecure(), grpc.WithBlock()) - if err != nil { - return nil, nil , fmt.Errorf("Error creating notifapi-grpc-client: %v", err) - } - cleanup := func() { - if conn != nil { - conn.Close() - } - } - return NewNotificationClient(conn), cleanup, nil - } - - func doit() error { - client, cleanup, err := NewGrpcClient(":16123") - if err != nil { - return err - } - defer cleanup() - ..... - -#---------------------------------------------- - #* Overridable functions #- Interfaces more suitable for overriding however you might encounter this