Our great sponsors
-
In this specific example, I can't imagine how all of this exposed plumbing and error handling adds much value for the person reading or writing the code. In fairness, however, the Go code could easily be moved into function that does all of the dirty work and presents a minimal interface...which is what the Python example is doing:
https://github.com/docker/docker-py/blob/923e067dddc3d4b86e4...
-
-
InfluxDB
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
-
Author of the Docker Python SDK and attempted author of a better Docker Go SDK here.
The Go SDK is very low level, and a lot of the high level stuff happens inside the client code in a way that is hard to extract. There was an effort to abstract that in a way that could be reused but it was never prioritized so got stuck on the backburner. I attempted to create a separate SDK that the Docker client didn't build upon, but, if I recall correctly, there wasn't much appetite to do that because then we would have to maintain two codebases and it wouldn't automatically get better when we fixed bugs/improved things in the Docker client.
Here was the prototype: https://github.com/bfirsh/docker-sdk-go
As others say here, Go code does tend to be more verbose, but the Docker Go SDK is very low level and could be higher level. It doesn't have a `Run()` function for example, and there is no technical reason why it couldn't.