• Matthew Dempsky's avatar
    cmd/internal/ld: edit into more idiomatic Go code · 717cb749
    Matthew Dempsky authored
    Instead of reimplementing chained hash tables, just use maps.
    
    Use bool instead of uint8 for variables only set to 0 or 1.
    
    Fix parsing of `import foo "foo" // indirect` lines.  Previously, this
    was treated as an import of package path `"foo" // indirect`, which
    could result in the cycle-detection code failing to detect a cycle
    because it would be treated as a separate package from `"foo"`.
    
    Also, since there are theoretically multiple quoted forms for a
    package path, use strconv.Unquote to normalize them.  Side benefit:
    Unquote will complain if any trailing comments sneak back in.
    
    Aside: For most Go archives, Go package data is only present in the
    __.PKGDEF member, but unless -u is used, ldpkg is only called on the
    _go_.6 member.  Consequently, importcycles is a no-op when -u isn't
    used as it has no package data to inspect.
    
    Change-Id: I7076cf91a66726a8d9c5676adfea13c5532001fa
    Reviewed-on: https://go-review.googlesource.com/7002Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Matthew Dempsky <mdempsky@google.com>
    Reviewed-by: 's avatarRob Pike <r@golang.org>
    717cb749
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...