Restricting ripgrep to certain file types

I’ve been using ripgrep to search files for awhile, but I hadn’t figured out how to recursively search only certain file types. Anytime I needed to search, say, for any occurrence of “doFoo” in Go...