diff --git a/format/format.go b/format/format.go index 7316eb7..64e5c15 100644 --- a/format/format.go +++ b/format/format.go @@ -978,10 +978,8 @@ func (f *fumpter) joinStdImports(d *ast.GenDecl) { case periodIndex > 0 && (slashIndex == -1 || periodIndex < slashIndex), // "test" and "example" are reserved as per golang.org/issue/37641. - // "internal" is unreachable. strings.HasPrefix(path, "test/"), strings.HasPrefix(path, "example/"), - strings.HasPrefix(path, "internal/"), // See if we match modulePrefix; see its documentation above. // We match either exactly or with a slash suffix, diff --git a/testdata/script/std-imports.txtar b/testdata/script/std-imports.txtar index 4053ae7..6b39d89 100644 --- a/testdata/script/std-imports.txtar +++ b/testdata/script/std-imports.txtar @@ -160,10 +160,11 @@ import ( // All of the extra imports below are known to not belong in std. // For example/ and test/, see https://golang.org/issue/37641. import ( + "internal/bar" "io" "example/foo" - "internal/bar" + "test/baz" )