internal/imports: restore fixImports extension point

http://go.dev/cl/589975 incorrectly made fixImports a regular function
because the extension was not visible in the tools repository.

Google-internally, we do use this extension point.

Change-Id: I7ff41e49f852e0f72671141a7a2baa272ec5a6ce
Reviewed-on: https://go-review.googlesource.com/c/tools/+/591035
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Stapelberg <stapelberg@google.com>
diff --git a/internal/imports/fix.go b/internal/imports/fix.go
index 882dd42..31f8d1a 100644
--- a/internal/imports/fix.go
+++ b/internal/imports/fix.go
@@ -561,7 +561,12 @@
 
 // fixImports adds and removes imports from f so that all its references are
 // satisfied and there are no unused imports.
-func fixImports(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) error {
+//
+// This is declared as a variable rather than a function so goimports can
+// easily be extended by adding a file with an init function.
+var fixImports = fixImportsDefault
+
+func fixImportsDefault(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) error {
 	fixes, err := getFixes(context.Background(), fset, f, filename, env)
 	if err != nil {
 		return err