Module `github.com/golang/glog` and any modules that depend on it cannot be run with Yaegi
jimeh opened this issue · comments
Jim Myhrberg commented
The following program sample.go
triggers an unexpected result
package main
import (
"flag"
"github.com/golang/glog"
)
func main() {
flag.Parse()
glog.Error("hello world")
}
Expected result
$ go run ./sample.go
E1021 13:11:18.826221 41979 sample.go:19] hello world
Got
$ yaegi ./sample.go
run: ./sample.go:14:2: import "github.com/golang/glog" error: /Users/jimeh/.go/src/playground/at-2022-10-21-124457/vendor/github.com/golang/glog/glog.go:632:15: cannot use type *glog.buffer as type io.Writer
Yaegi Version
Additional Notes
Setup involved a this go.mod
:
module playground/at-2022-10-21-124457
go 1.19
require github.com/golang/glog v1.0.0
Followed by tidying and vendoring the dependencies:
go mod tidy
go mod vendor
Resulting in the following directory structure:
$ tree -a
.
├── go.mod
├── go.sum
├── sample.go
└── vendor
├── github.com
│ └── golang
│ └── glog
│ ├── LICENSE
│ ├── README.md
│ ├── glog.go
│ └── glog_file.go
└── modules.txt
4 directories, 8 files