Dropbox just rewrote parts of their Go infra into Rust explicitly because of the memory savings they needed.
Of course, if you have checked exceptions (which are for some unfathomable reason considered bad nowadays), nothing just throws an exception. Moreover, you don't know for sure whether a Go library correctly handles errors, because it's so easy to ignore them.
At my last job, very few methods in the application ended up throwing a specific list of exceptions, except the most leaf-ward modules. Anything anywhere near the application logic just threw our top level generic exception, because there was too much below them that could throw a variety of exceptions, and there generally was nothing the middle-tier code could do about it if they failed.
It's really not that easy to ignore errors in Go in practice... and you might as well worry that a library correctly handles the result of string.Split() incorrectly. Either one is a bug. Hopefully your tests would find either one, and there are tools to detect errors you didn't handle.
You don't do that in API-stable code, period. If you are working with API-unstable code - that's the point of static typing. The code won't compile because the intention is exactly to signal that something has changed.
If you change the return type of a low-level Go function, you will have to modify its callers as well.
Anything anywhere near the application logic just threw our top level generic exception,
Bad codebase = bad. Sure. I never encountered that problem in the Java codebases I worked on at various employers. (And I'd be quite happy to complain about Java, I don't like it.)
It's really not that easy to ignore errors in Go in practice...
It is. The compiler will not emit a warning when you ignore the return value of a function/method. Here:
fmt.Println("Hello world")
I have just ignored an error. The compiler is happy. There are quite some Go packages in the wild that do not deal with errors when they need to.Any library that panics for reasons other than a programmer bug would never be used by the community. I read a lot of Go code and look at a lot of Go libraries, and I've never seen one that said it purposely panics in my 3.5 years of writing Go.
Compared to Java, C#, Python, C++ etc... where declaring your code panics is a perfectly normal and expected way to report errors.
it's considered bad practice in go library code to panic(), while it is considered normal error handling to throw an exception in java.
also note that you can catch a panic in go, and use it as some kind of exceptions if you really must.
https://github.com/golang/go/wiki/PanicAndRecover#usage-in-a...
But mostly, you may find you just enjoy writing Go more than Java. It writes a lot like python... I switched from mainly writing C# to almost exclusively writing Go, and whoo boy, I'm not going back. No more huge class hierarchies, no more "everything has to be in a class"... no more "anything I call may throw and jump me out of my function in the middle and I have no idea if it will or not".
There's just a lot of niceties of writing Go that don't exist in Java. Sure, there's a ton you can do in Java that you can't do in Go, but once you stop focusing on what Go can't do, you realize, it still can do pretty much whatever you want.