Skip to content

Commit

Permalink
Kubilay intro
Browse files Browse the repository at this point in the history
  • Loading branch information
kubilaykarpat committed Jan 15, 2025
1 parent 10b2a2e commit 4b5cf16
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 41 deletions.
Binary file added examples/images/kubi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
95 changes: 54 additions & 41 deletions go-training.slide
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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?
Expand Down Expand Up @@ -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 <variadic>
.play -edit examples/variadic/variadic.go

Expand Down Expand Up @@ -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 <emailapi>
#- Interfaces more suitable for overriding however you might encounter this

Expand Down

0 comments on commit 4b5cf16

Please sign in to comment.