]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove -importmap flag
authorMatthew Dempsky <mdempsky@google.com>
Wed, 29 Jun 2022 20:03:51 +0000 (13:03 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 13 Jul 2022 21:42:13 +0000 (21:42 +0000)
Obsoleted by -importcfg, and no longer used by anything.

Updates #51225.

Change-Id: I49e646d2728347f862f90805051bb03dd4f4bed2
Reviewed-on: https://go-review.googlesource.com/c/go/+/415235
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/doc.go
src/cmd/compile/internal/base/flag.go

index b8862f62cf11739b0cba9a087a2192eddb8eb277..60e12630c5580eb217d4f51c71fb5a7c5a7fd346 100644 (file)
@@ -68,9 +68,6 @@ Flags:
        -importcfg file
                Read import configuration from file.
                In the file, set importmap, packagefile to specify import resolution.
-       -importmap old=new
-               Interpret import "old" as import "new" during compilation.
-               The option may be repeated to add multiple mappings.
        -installsuffix suffix
                Look for packages in $GOROOT/pkg/$GOOS_$GOARCH_suffix
                instead of $GOROOT/pkg/$GOOS_$GOARCH.
index 4de0df21cbb7b21a029c14f0b400cd30c780422f..a363b83984785496504b2f4c8b4fd9a85035187d 100644 (file)
@@ -100,7 +100,6 @@ type CmdFlags struct {
        GenDwarfInl        int          "help:\"generate DWARF inline info records\"" // 0=disabled, 1=funcs, 2=funcs+formals/locals
        GoVersion          string       "help:\"required version of the runtime\""
        ImportCfg          func(string) "help:\"read import configuration from `file`\""
-       ImportMap          func(string) "help:\"add `definition` of the form source=actual to import map\""
        InstallSuffix      string       "help:\"set pkg directory `suffix`\""
        JSON               string       "help:\"version,file for JSON compiler/optimizer detail output\""
        Lang               string       "help:\"Go language version source code expects\""
@@ -130,7 +129,7 @@ type CmdFlags struct {
                        Files    map[string]string
                }
                ImportDirs   []string          // appended to by -I
-               ImportMap    map[string]string // set by -importmap OR -importcfg
+               ImportMap    map[string]string // set by -importcfg
                PackageFile  map[string]string // set by -importcfg; nil means not in use
                SpectreIndex bool              // set by -spectre=index or -spectre=all
                // Whether we are adding any sort of code instrumentation, such as
@@ -156,7 +155,6 @@ func ParseFlags() {
        Flag.EmbedCfg = readEmbedCfg
        Flag.GenDwarfInl = 2
        Flag.ImportCfg = readImportCfg
-       Flag.ImportMap = addImportMap
        Flag.LinkShared = &Ctxt.Flag_linkshared
        Flag.Shared = &Ctxt.Flag_shared
        Flag.WB = true
@@ -388,21 +386,6 @@ func addImportDir(dir string) {
        }
 }
 
-func addImportMap(s string) {
-       if Flag.Cfg.ImportMap == nil {
-               Flag.Cfg.ImportMap = make(map[string]string)
-       }
-       if strings.Count(s, "=") != 1 {
-               log.Fatal("-importmap argument must be of the form source=actual")
-       }
-       i := strings.Index(s, "=")
-       source, actual := s[:i], s[i+1:]
-       if source == "" || actual == "" {
-               log.Fatal("-importmap argument must be of the form source=actual; source and actual must be non-empty")
-       }
-       Flag.Cfg.ImportMap[source] = actual
-}
-
 func readImportCfg(file string) {
        if Flag.Cfg.ImportMap == nil {
                Flag.Cfg.ImportMap = make(map[string]string)