withmock
withmock copied to clipboard
Fails for packages with "internal" imports
Steps to reproduce:
-
go get https://github.com/hack4impact/audio-transcription-service
-
cd $GOPATH/src/github.com/hack4impact/audio-transcription-service
-
git checkout 0b860e525f69e9a5aea82a52a0040faf34503ed9
-
mocktest -work ./...
Expected:
- mocktest runs correctly
Actual:
- The following error is output
ERROR: Failed to install '_et/http': exit status 1
output:
package _et/http
imports internal/golang.org/x/net/http2/hpack: use of internal package not allowed
What might be the problem?
I took a look at the temporary work directory and the file at path/src/_et/http/http_ifmocks.go
has the following import:
import (
...
hpack "internal/golang.org/x/net/http2/hpack"
)
I think the error is one of two things:
- This copy of the http library doesn't have permission to use the internal package.
- The package
internal/golang.org/x/net/http2/hpack
isn't copied by withmock.
However, I do not have a very good idea of what the problem is. I would appreciate if someone could clarify if I did something wrong or if there is a bug with withmock.
@qur have you gotten a chance to look at this?