modfile: prefer to add a new 'go' directive after the 'module' directive

The previous behavior put the new 'go' directive at the end of the
file, which is not where anybody actually puts it, and that in turn
complicates the regression tests for golang/go#34822.

Updates golang/go#34822

Change-Id: Ic275eb6999fc0db7e72e2d9636b77c9e3d919539
Run-TryBot: Bryan C. Mills <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Jay Conrod <>
3 files changed