Gonzalez was drafted by the Chicago White Sox in the first round of the 2004 amateur draft out of Monsignor Edward Pace High School in Opa Locka, Florida. In 2005 he was traded to the Philadelphia Phillies. He was a Mid-Season All-Star for the AA Reading Phillies, and was returned to the Sox in another trade in December 2006.
Gonzalez is known for his 90-93 mph fastballs and "nasty" slider. Gonzalez went 9-7 with a 3.18 ERA for the Barons. His 185 strikeout total led all of minor league baseball, and his 13 strikeouts in 7 innings against the Huntsville Stars on April 27 was a career high. He was the sole Baron named to the 2007 Southern League All-Star Team.
In 2008 and 2009 Gonzalez split time between the Oakland Athletics and the Sacramento River Cats of the AAA Pacific Coast League. He made his first Major League appearance for Oakland in 2008 and started 17 games for the A's in 2009, going 6-7 with a 5.75 ERA. In 2010 Gonzalez became a regular starter with a 15-9 record in 33 starts and a 3.23 ERA. In 2011 he recorded 197 strikeouts on the way to a 16-12 record in 32 starts and a 3.12 ERA. He was traded to the Nationals in 2012 and started the season 12-5 in 19 starts with a 3.32 ERA.