Is this possible in the golang? and why?
No, because the golang is not such a language. It is intended to be compiled, not interpreted, so the runtime does not contain a line-to-code transformer or does not know what a syntactically correct program looks like.
Please note that in Go, as in most other programming languages, you can write your own interpreter, that is, a function that takes a string and calls the corresponding calculations. The choice of Go designers is not to impose a feature of such dubious interest and safety for all who do not need it.
source share