• Russ Cox's avatar
    cmd/buildid: add new tool factoring out code needed by go command · 9ad2319b
    Russ Cox authored
    This CL does a few things.
    
    1. It moves the existing "read a build ID" code out of the go command
    and into cmd/internal/buildid.
    
    2. It adds new code there to "write a build ID".
    
    3. It adds better tests.
    
    4. It encapsulates cmd/internal/buildid into a new standalone program
    "go tool buildid".
    
    The go command is going to use the new "write a build ID" functionality
    in a future CL. Adding the separate "go tool buildid" gives "go build -x"
    a printable command to explain what it is doing in that new step.
    (This is similar to the go command printing "go tool pack" commands
    equivalent to the actions it is taking, even though it's not invoking pack
    directly.) Keeping go build -x honest means that other build systems can
    potentially keep up with the go command.
    
    Change-Id: I01c0a66e30a80fa7254e3f2879283d3cd7aa03b4
    Reviewed-on: https://go-review.googlesource.com/69053Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
    9ad2319b
rewrite.go 2.82 KB