It might be better to just introduce a blank line between the stdlib imports and 3rd-party or internal imports. gofmt will respect the separation and only sort within each blank-line-delimited set.