How to multiply two Public Keys in Elliptic Curve in Go
Now my question is to how to implement $g^{a*B}$ which are both public keys?


Just given $g^a$ and $g^B$, this is a hard problem (or so we hope); if that is feasible, the strength of the entire system falls apart.

However, both Alice and Bob can compute: for Alice, she computes $(g^B)^a$ (given the value $g^B$ from Bob and her secret $a$).  Similarly, Bob computes $(g^a)^B$ (given the value $g^a$ from Alice and his secret $B$)

Both computations yield the common value $g^{a\cdot B}$