In some cases, it may be possible to obtain a special permit or license to operate a gas golf cart on public roads, but this is typically only allowed in limited circumstances, such as in a low-speed community or for agricultural purposes.
Because regulations pertaining to street-legal golf carts vary vastly state by state, if you wish to take advantage of them and be compliant, ensure this with local law enforcement to avoid possible consequences or hefty fines.