Do you really need all the infrastructure and libraries used by Java programmers these days to create a microservice? A microservice is supposed to be a small, standalone piece of software that can be deployed and run on a server. With Go, you don’t need all of this infrastructure or programmers who have years of experience in the Java world to create a microservice.
You could use GRPC or REST to create a microservice. If needed, have a small team to work on Java based microservices. You could also have teams working on Go based microservices. I am confident anyone with less years of experience can learn and write microservices in Go, with a training of a few months.
Go is extremely small language and it is very easy to learn. This allows for extremely easy on-boarding. Reading Go code and understanding it is not difficult.
Tooling is excellent. All tools are extremely fast and lightweight. Lining, compiling, building, etc., are fast. Even low powered laptops can be used for development.
Go is a value-based language. Go doesn’t need functional programming features to write correct code. No need of records (currently in Java), pattern matching (next version of Java), lambdas etc.
This also makes Go very efficient both in memory and in performance. Java could only compete with Go if you provide enough memory and CPU.
This also makes garbage collector efficient and simple. Very little garbage is generated.
This model will be part of Java in future, maybe a few years (project Valhalla)
Go has no virtual machine, huge platform libraries, or a sophisticated garbage collector. Go compiles to machine code. It supports static linking. This leads to very fast load times and very efficient resource usage.
One of the important attributes of microservices would be reactive programming, achieved mostly through concurrency and asynchronous programming. Go internally uses async.io but provides the simpler programming model of blocking code.
Also, concurrency is made dramatically simpler, by using channels. You don’t share any data, so don’t need to worry about thread safety in most code. This model of concurrency will be part of Java in future, may be five years (project loom).
No need for sophisticated reactive libraries at different levels of abstraction and different layers of software.
Go was intended to replace Java and C++ in distributed/cloud systems. And it has excellent low latency, high performance and robust networking and infrastructure libraries.
Real advantage of Go over java would be evident only after one starts using it. Writing rest based microservices is similar to writing express apps than spring based Java.