Last Monday I gave a remote workshop about Go programming. It has been an interesting experience, not yet done something similar before. Sadly I needed too much time for the basic topics. So I had not enough time in the end to dive into my example. This has been a module containing a little declarative environment for components, a bit like Kubernetes. As a result I decided to create an online training for Go based on an improved version of that example.
The JAX conference typically focusses on Java technologies, the J of the name already shows it. But over the last years it opened more and more for other languages or external infrastructure technologies influencing the system architecture for solutions.
And so this year in May I had the chance to give an introduction into Google Go as an alternative programming language. The slides can be found at SlideShare as usual. But additionally the organizers recorded the one hour talk on video.
What shall be special when working with functions? They are part of software development almost since beginning, there’s even the paradigm of functional programming. So what’s special with functions in Go? Simple answer: nothing. But true to the motto of the language the work with functions and their relatives, the methods, is very pragmatic. And so they get parts of elegant solutions.
Let’s start with quite simple functions. They can be small, having none, one, more or a variable number of parameters.
Pretty often you read questions about multiplexing in Go web application on Slack, StackOverflow, or Reddit. Sometimes they think about using libraries like gorilla/mux, which is a powerful software, and its alternatives. Depending on individual requirements and constraints these may make sense, but for many cases the standard library or own little packages based on the standard library are more than enough. I’ll show the idea behind the Go net/http package and how to build own solutions based on it.