constabulary / gb

gb, the project based build tool for Go
https://getgb.io/
MIT License
2.15k stars 148 forks source link

test fails to find standard lib import #680

Closed bndw closed 7 years ago

bndw commented 7 years ago

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 7 years ago

I'm not able to reproduce this issue, see #681 for a test that confirms this.

davecheney commented 7 years ago

Hmm, looks like httptest may not have existed in 1.6 and earlier. Let me check.

davecheney commented 7 years ago

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 7 years ago

@davecheney Thanks for the lightning fast followup and resolution!

davecheney commented 7 years ago

No worries.

On Tue, Dec 13, 2016 at 4:14 PM, bndw notifications@github.com 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 https://github.com/constabulary/gb/issues/680#issuecomment-266644995, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAcAzWT2urLfA75_2-B12qBB7_SOjiSks5rHim5gaJpZM4LLRKZ .