forked from golang/go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: update go bug to be more consistent with Github issue template
As a result of using go env, the following new environment variables are shown as part of the env section: +CGO_CFLAGS="-g -O2" +CGO_CPPFLAGS="" +CGO_CXXFLAGS="-g -O2" +CGO_FFLAGS="-g -O2" +CGO_LDFLAGS="-g -O2" +PKG_CONFIG="pkg-config" +GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build612849170=/tmp/go-build -gno-record-gcc-switches" Fixes golang#26751 Change-Id: I32baca1c3c06d08068dad0041a43a1f5532bd91e
- Loading branch information
1 parent
24f846e
commit 7e1e56b
Showing
2 changed files
with
80 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Verify that go bug creates the appropriate URL issue body | ||
|
||
[!linux] skip | ||
|
||
go install | ||
env BROWSER=$GOPATH/bin/browser | ||
go bug | ||
exists $TMPDIR/browser | ||
grep '^go version' $TMPDIR/browser | ||
grep '^GOROOT/bin/go version: go version' $TMPDIR/browser | ||
grep '^GOROOT/bin/go tool compile -V: compile version' $TMPDIR/browser | ||
grep '^uname -sr: Linux' $TMPDIR/browser | ||
grep 'GNU C Library' $TMPDIR/browser | ||
|
||
-- go.mod -- | ||
module browser | ||
|
||
-- main.go -- | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"net/url" | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
func main() { | ||
u, err := url.Parse(os.Args[1]) | ||
if err != nil { | ||
panic(err) | ||
} | ||
body, err := url.PathUnescape(u.Query().Get("body")) | ||
if err != nil { | ||
panic(err) | ||
} | ||
out := filepath.Join(os.TempDir(), "browser") | ||
f, err := os.Create(out) | ||
if err != nil { | ||
panic(err) | ||
} | ||
fmt.Fprintln(f, body) | ||
if err := f.Close(); err != nil { | ||
panic(err) | ||
} | ||
} | ||
|