Currently, my import block looks something like:
import (
"bytes"
"math"
"reflect"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"google.golang.org/protobuf/internal/encoding/pack"
pimpl "google.golang.org/protobuf/internal/impl"
"google.golang.org/protobuf/internal/pragma"
ptype "google.golang.org/protobuf/internal/prototype"
"google.golang.org/protobuf/internal/scalar"
pref "google.golang.org/protobuf/reflect/protoreflect"
preg "google.golang.org/protobuf/reflect/protoregistry"
piface "google.golang.org/protobuf/runtime/protoiface"
proto2_20180125 "google.golang.org/protobuf/internal/testprotos/legacy/proto2.v1.0.0-20180125-92554152"
)
Most of the import paths have a shared prefix, but the lack of aligning makes this hard to see. Preferably, gofmt would align the imports like:
import (
"bytes"
"math"
"reflect"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"google.golang.org/protobuf/internal/encoding/pack"
pimpl "google.golang.org/protobuf/internal/impl"
"google.golang.org/protobuf/internal/pragma"
ptype "google.golang.org/protobuf/internal/prototype"
"google.golang.org/protobuf/internal/scalar"
pref "google.golang.org/protobuf/reflect/protoreflect"
preg "google.golang.org/protobuf/reflect/protoregistry"
piface "google.golang.org/protobuf/runtime/protoiface"
proto2_20180125 "google.golang.org/protobuf/internal/testprotos/legacy/proto2.v1.0.0-20180125-92554152"
)
Currently, my import block looks something like:
Most of the import paths have a shared prefix, but the lack of aligning makes this hard to see. Preferably,
gofmtwould align the imports like: