GopherCon Europe Berlin 2023

25.07.23 by Bahareh Ketabi, Enisha Eshwar, Yusef Mohamadi

GopherCon Europe Berlin 2023

Delivery Hero Logo

4 min read

Delivery Hero was delighted to attend Gopher EU 2023 as a sponsor, which took place at Festsaal Kreuzberg from June 26th to 29th, offering a captivating lineup of workshops and talks.

Workshop: Ultimate service with Kubernetes

Bill Kennedy is a well-known name in the world of Go and his workshop for “Ultimate Service with Kubernetes” was something that had garnered a lot of interest. Participants had the opportunity to follow along with the instructor as he guided them through the process of building a production-level microservice in Go. 

What was particularly appealing about this workshop was its emphasis on design philosophies. Starting from the basics, it provided valuable reminders for experienced Go programmers while also serving as an excellent introduction for newcomers to the language. This focus on design philosophies enables participants to make better engineering decisions when working with Go, ultimately leading to more robust and efficient code.

Sometimes, it’s the most obvious things that we tend to ignore, yet they hold significant importance:

  • Code quality and maintainability: Make your code easy to understand and optimize it for the day when you have a bug in production. Develop the ability to write code that can be maintained by anyone, ensuring its long-term viability.
  • Productivity, correctness, and performance: When writing code, prioritize correctness over premature optimization. Focus on maintaining the integrity, simplicity, and readability of your code.
  • Packaging and layering: Packages should “provide” rather than “contain”. Maintain a clear and organized layering structure, using thin API interfaces between layers. Remember that imports should only go downwards and never the other way around.
  • Logging: Logs should be informative and have a high signal-to-noise ratio. Slog is a logging package that was recommended for use.
  • Config and local setup: Configs should only be read in the main. It’s essential to provide default values for all configurations, preferably using dev values that can also facilitate a quick local setup. Additionally, consider logging all configurations while masking sensitive information.
  • Returning a value vs. a pointer: 
    • Follow these guidelines:
      • Functions that are expected to return values should indeed return values, except when returning nil is necessary.
      • If you are returning a struct that contains data, return a value.
      • If you are returning a struct that represents an API or an interface, it’s advisable to return a pointer.

Race condition in Golang

Our colleague Yusef Mohamadi (Senior Software Engineer) gave a lightning talk about race conditions in Golang. A race condition is a situation in concurrent programming where the behaviour or outcome of a program depends on the relative timing or interleaving of multiple concurrent operations, and the program has not been designed to handle or ensure a specific order of execution. This lack of synchronization can lead to unexpected results.

The figure above shows a simple situation where a race condition could occur, leading to an indeterminate shared variable.

Taking inspiration from Go’s primitives and concurrent tools, we can effectively prevent and detect race conditions in our code. Go, with its powerful features, enables developers to write efficient and concurrent programs. Using goroutines, lightweight functions that can run concurrently, developers can execute tasks simultaneously without needing to worry about low-level thread management. These goroutines make it easy to harness the benefits of concurrency. Additionally, Go provides channels, which are communication channels that enable safe and synchronized data exchange between goroutines. By combining goroutines and channels, developers can create scalable and reliable concurrent applications. Go’s concurrency primitives provide a straightforward and effective solution for writing high-performance code that can execute multiple tasks concurrently.

A few other talks we liked

How to handle breaking changes in Go modules

Breaking or incompatible changes account for an increment in the major version, following the semantic versioning. It is interesting to note that Golang is still in version 1.x. This talk delved into the intricacies of how the engineers at Grafana Labs adeptly navigated breaking changes with Go modules, by carefully balancing the relationships between repositories, modules, and packages. 

The focus was on avoiding the grouping of independent elements under the same umbrella, where a modification in one element would necessitate a complete versioning update. For instance, initially, Instrumentation and HTTP client in Prometheus were in the same package. Any alterations made to either component would trigger a version change.

A fast structured logging package

“A Fast Structured Logging Package” was one of the standout talks at the conference. Jonathan Amsterdam shared valuable insights on optimizing logging systems for improved efficiency. This talk provided practical techniques and best practices for implementing a robust logging solution.

Vulnerability management for Go

This talk discussed the importance of using secure packages in Go and provided valuable guidance on ensuring the packages we use are not prone to vulnerability. Julie Qui offered practical tips and recommendations to help developers strengthen their packages against vulnerabilities.

Simple hacks to cut memory usage 

Exploring the intricacies of memory management in the language shed light on how to optimize resource usage and improve performance in Go applications.

Conclusions and thanks

After a packed two-day schedule, we left the conference with new learnings and contacts! Thanks again to the organizers and speakers, we’re already looking forward to next year’s conference. See you there!


If you like what you’ve read and you’re someone who wants to work on open, interesting projects in a caring environment, we’re on the lookout for Engineering Managers and Staff Software Engineers. Check out our full list of open roles here – from Backend to Frontend and everything in between. We’d love to have you on board for an amazing journey ahead.

Bahareh Ketabi
Software Engineer
GopherCon Europe Berlin 2023
Enisha Eshwar
Senior Software Engineer
GopherCon Europe Berlin 2023
Yusef Mohamadi
Senior Software Engineer
Leveraging Real-Time Data for Enhanced User Experience: The Role of CDP at Delivery Hero

Next

Events

Leveraging Real-Time Data for Enhanced User Experience: The Role of CDP at Delivery Hero

Delivery Hero Logo
4 min read