C++ is the weird one out, you might have a declaration like:
int (*f)(int x);
The variable type is
around the variable name. Some of it is before and some of it is after. In Go it’s simpler:
var f func(int x) int
If I want a void function, I can just leave the return type off, I don’t need to add "void":
var f func(int x)
It’s easier to write a parser for this, because you know that this is a variable declaration just by looking at the very first token and finding a certain keyword. If you write a parser for C or C++ it’s much more complicated, because you have to keep track of which identifiers name types in the scope that you’re in. Generally, more modern languages like Java, C#, Go, and Rust are much easier to parse, they are often designed to be relatively straightforward to parse with e.g. an LL(1) parser, or close to it, maybe you can just use recursive descent.
In C++ it's also a bit inconsistent,
int f1(int x) { return x + 5; }
std::function f2;
auto f3 = [](int x) -> int { return x + 5 };
You also have to invent a placeholder for when there aren’t types:
int x = 3;
auto x = 3;
In Go you just omit the type, and you don’t need a placeholder:
var x int = 3
var x = 3
Other languages where the type comes after: Haskell, Python (PEP 484), ML, Rust, Pony, Nim, TypeScript, Swift.
In fact I think the way C/C++/C#/Java do it, with the type at the beginning, is actually somewhat rare.