modfile: return structured errors from Parse and ParseLax

Parse and ParseLax now return an ErrorList, which is a slice of Errors
that satisfies the error interface. Each Error now contains a file
name and position. The verb and module path fields are optional.

Fixes golang/go#36486

Change-Id: I2a244c8753cfce4bb290ddb8bcea5ee73c45f79f
Run-TryBot: Jay Conrod <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Rohan Challa <>
Reviewed-by: Michael Matloob <>
2 files changed