man setsockopt and look for SO_REUSEADDR/SO_REUSEPORT
You will have to use low level code like Socket(), Bind() etc. You can't
use e.g. Dial("tcp", "192.168.1.1:smtp")
Something like
err := syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1)
err := syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_REUSEPORT, 1)
https://github.com/libp2p/go-reuseport has an example.
Though IMHO such ports should be passed from an *external*
program for security purposes (your service enpoint shouldn't
be opening any ports on its own). Also makes it easier to
test.