Possible reasons are that he wants to get your attention. It can also mean that he is bored, excited, or possessive. Because he would prefer it if you recognized his every wish from the barking and always obeyed.
There are a number of reasons your Golden Retriever might do this. Or it may be due to a combination of reasons. However, there are a number of things you can do about it.
The reason could be that it is trying to get attention from you. Especially when he realizes that he's successful at it. The more you pay attention to him - and if you just tell him to stop - the more he'll bark at you.
Give him attention throughout the day, but only when you want it. Play with him, go for a walk or hide treats around the house or in the garden.
It may be that you inadvertently encouraged the misbehavior (in this case, his barking) by giving him things he wanted. That's how he learned that if he barks at you, he'll get what he wants.
Instead of giving him things like attention, toys, or treats when he barks, try rewarding him when he's well-behaved. So when he has calmed down and is not barking. So he associates good behavior with reward. You can give him treats as a reward, such as the dog snack box. However, subtract the treats from his regular food ration.
Golden Retrievers are a breed that should exercise daily. Not getting enough exercise for your dog can lead to them picking up some bad habits. Barking is part of it. Observe if your dog barks at you more often on the days when he might not be getting as much exercise. And then your task would be clear.
Veterinarians recommend that a healthy adult Golden Retriever should walk, frolic, and run for at least an hour a day.