• Russ Cox's avatar
    cmd/go: distinguish patterns from the results of matching them · d46587c4
    Russ Cox authored
    To date the go command has always just treated the command line
    package patterns as a []string, expanded by pattern matching into
    another []string. As a result, the code is not always clear about
    whether a particular []string contains patterns or results.
    A few different important bugs are caused by not keeping
    this distinction clear enough. This CL sets us up well for fixing those,
    by introducing an explicit search.Match struct holding the
    results of matching a single pattern.
    
    The added clarity here also makes it clear how to avoid duplicate
    warnings about unmatched packages.
    
    Fixes #26925. (Test in followup CL.)
    
    Change-Id: Ic2f0606f7ab8b3734a40e22d3cb1e6f58d031061
    Reviewed-on: https://go-review.googlesource.com/129058
    Run-TryBot: Russ Cox <rsc@golang.org>
    Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
    d46587c4
build.go 18.5 KB