Convert Java code to something like Go