ごとく or 如く is literal diction and not normally used (sounds pedantic) in conversational speech. ような or ように can usually replace ごとく. As between 生けるがごとく and 生けるごとく, the former is the conventional usage, but the latter is more or less acceptable (with emphasis on "less").
I've overwritten #5433 with an example which contains the grammar point and moved the previous example up into notes. That way, those people giving the page a thorough read can be alerted to the difference, while those just scrolling down to get examples of the actual grammar point won't be confused by unrelated sentences. Does this keep everyone happy?