]> Cypherpunks repositories - gostls13.git/commit
cmd/go: avoid type names in __debug__modinfo__ variable injected in package main
authorBryan C. Mills <bcmills@google.com>
Wed, 12 Sep 2018 14:41:29 +0000 (10:41 -0400)
committerBryan C. Mills <bcmills@google.com>
Wed, 12 Sep 2018 18:46:57 +0000 (18:46 +0000)
commit21f3d5816d5dc3556a3ac9a5c91b915848be254b
treea15e6fa94b85dee806f40266f6261c395f73f906
parentb07f60b97ff5ea9ae4cf21b549e9d25ccd695f36
cmd/go: avoid type names in __debug__modinfo__ variable injected in package main

If we use the name 'string' to refer to the built-in type, that name
can be shadowed by a local declaration. Use a string constant instead,
but keep the init function to populate it so that //go:linkname will
still work properly.

Fixes #27584.

Change-Id: I850cad6663e566f70fd123107d2e4e742c93b450
Reviewed-on: https://go-review.googlesource.com/134915
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/internal/modload/build.go
src/cmd/go/testdata/script/mod_string_alias.txt [new file with mode: 0644]