There are two kinds of answers.
One is that the spec only permits setting fields of a struct that is
addressable, and the result of a function call is not addressable.
See
https://golang.org/ref/spec#Assignments and
https://golang.org/ref/spec#Address_operators .
The other kind of answer is that if a function returns a pointer to a
struct, a value of type *employee, then it's normal for that something
else to have a copy of that pointer, perhaps some data structure or
global variable. In your simple example that is the global variable
"dilbert". So it makes sense to permit setting a field of the result
of calling getEmployee(), a value of type *employee, as setting that
field will change the global variable "dilbert". But when
getEmployee() does not return a pointer, but just returns a value of
type "employee", then that is a copy of the value in the global
variable. Changing a field in that copy won't change anything. The
assignment will be made, and then the result will be discarded. Since
that operation is useless, the language does not permit it.
Ian