test fails to find standard lib import
Closed this issue · 5 comments
bndw commented
gb test
is failing to find the net/http/httptest
subdirectory
// src/foo/foo_test.go
package main
import (
"net/http/httptest"
"testing"
)
func TestFoo(t *testing.T) {
_ = httptest.NewRequest("", "https://example.com", nil)
}
$ gb test -a
foo_test.go:9: undefined: httptest.NewRequest
FATAL command "test" failed: exit status 2
davecheney commented
I'm not able to reproduce this issue, see #681 for a test that confirms this.
davecheney commented
Hmm, looks like httptest may not have existed in 1.6 and earlier. Let me check.
davecheney commented
Yup, httptest.NewRequest
was added in Go 1.7.
If you have upgraded your Go installation you must rebuild gb. Sorry about this limitation, it's not an easy one to overcome.
bndw commented
@davecheney Thanks for the lightning fast followup and resolution!
davecheney commented
No worries.
…On Tue, Dec 13, 2016 at 4:14 PM, bndw ***@***.***> wrote:
@davecheney <https://github.com/davecheney> Thanks for the lightning fast
followup and resolution!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#680 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAcAzWT2urLfA75_2-B12qBB7_SOjiSks5rHim5gaJpZM4LLRKZ>
.