My company has tried to adopt a convention placing import paths into three groups: standard library followed by third-party packages followed by local packages. For example
import (
"database/sql"
"io"
"strconv"
"github.com/lib/pq"
"mycompany.com/foo/bar"
"mycompany.com/foo/baz"
)
We'd like to be able to add a flag to our goimports-on-save hook, like
goimports -local mycompany.com/
to tell goimports to put any paths beginning with "mycompany.com/" into our third group. I think that would end up as group value 3 in the goimports source: stdlib=0, 3rd party=1, appengine=2, then local=3.
If this sounds reasonable, I can write a patch.