How can I programmatically get a list of GO terms associated with a gene identifier?

This very useful BIOSTARS thread clarifies "How Do I Do Simple GO Term Lookup Given A Gene (Or mRNA) Identifier?" You might find these responses useful when trying to simply create a list of GO terms associated with a given ID- and when you are not looking to conduct enrichment analyses - using a programatic approach. https://www.biostars.org/p/1226/