[clementauger@Host-001 jenjen-stream] $ go version
go version go1.13.4 linux/amd64
[clementauger@Host-001 jenjen-stream] $ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/clementauger/.cache/go-build"
GOENV="/home/clementauger/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/clementauger/gow"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/clementauger/.gvm/gos/go1.13.4"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/clementauger/.gvm/gos/go1.13.4/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/clementauger/gow/src/github.com/clementauger/jenjen-stream/go.mod"
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-build597193614=/tmp/go-build -gno-record-gcc-switches"
[clementauger@Host-001 jenjen-stream] $ sudo rm -fr /home/clementauger/gow/pkg/mod/github.com/hashicorp/go-multierror@v1.0.0/
[clementauger@Host-001 jenjen-stream] $ sudo rm -fr /home/clementauger/gow/pkg/mod/github.com/hashicorp/errwrap@v1.0.0/
[clementauger@Host-001 jenjen-stream] $ sudo rm -fr /home/clementauger/gow/pkg/mod/github.com/hashicorp/
[clementauger@Host-001 jenjen-stream] $ cat go.mod
module github.com/clementauger/jenjen-stream
go 1.13
require github.com/hashicorp/go-multierror v1.0.0
[clementauger@Host-001 jenjen-stream] $ go get ./...
go: extracting github.com/hashicorp/go-multierror v1.0.0
go: extracting github.com/hashicorp/errwrap v1.0.0
[clementauger@Host-001 jenjen-stream] $ ll /home/clementauger/gow/pkg/mod/github.com/hashicorp/
total 8
dr-x------ 2 clementauger clementauger 4096 22 nov. 20:35 errwrap@v1.0.0
dr-x------ 2 clementauger clementauger 4096 22 nov. 20:35 go-multierror@v1.0.0
$ jenjen -template=github.com/clementauger/jenjen-stream - "T => string, StreamT => StreamString, stream => streamString"
/home/clementauger/gow/pkg/mod/github.com/hashicorp/go-multierror@v1.0.0/prefix.go:6:2: could not import github.com/hashicorp/errwrap (go/build: importGo github.com/hashicorp/errwrap: exit status 1
error writing go.mod: open /home/clementauger/gow/pkg/mod/github.com/hashicorp/go-multierror@v1.0.0/go.mod298498081.tmp: permission denied
)
2019/11/22 20:37:34 couldn't load packages due to errors: github.com/hashicorp/go-multierror
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x647257]
goroutine 1 [running]:
golang.org/x/tools/go/loader.(*Program).InitialPackages(0x0, 0x1, 0x1, 0xc00244fdf0)
/home/clementauger/gow/pkg/mod/golang.org/x/to...@v0.0.0-20191121172411-96ad48e4b060/go/loader/loader.go:372 +0x37
main.main()
/home/clementauger/gow/src/github.com/clementauger/jenjen/cmd/jenjen/main.go:132 +0x946
var conf loader.Config
conf.FromArgs([]string{dst}, false)
prog, err := conf.Load()
if err != nil {
log.Println(err)
}
i := prog.InitialPackages()
if len(i) > 0 && len(i[0].Files) > 0 {
dstPkgName = i[0].Files[0].Name.Name
dstFp = prog.Fset.File(i[0].Files[0].Pos()).Name()
}
Now using version go1.13.4
[clementauger@Host-001 ~] $ ll gow/
bin/ pkg/ src/
[clementauger@Host-001 ~] $ ll gow/
bin/ pkg/ src/
[clementauger@Host-001 ~] $ ll gow/pkg/mod/
cache/ github.com/ golang.org/ gopkg.in/
[clementauger@Host-001 ~] $ ll gow/pkg/mod/github.com/apex/
total 4
dr-xr-xr-x 5 clementauger clementauger 4096 15 oct. 21:00 log@v1.1.1
[clementauger@Host-001 ~] $ ll gow/pkg/mod/github.com/apex/*/*
-r--r--r-- 1 clementauger clementauger 794 15 oct. 21:00 gow/pkg/mod/github.com/apex/l...@v1.1.1/default.go
-r--r--r-- 1 clementauger clementauger 430 15 oct. 21:00 gow/pkg/mod/github.com/apex/l...@v1.1.1/doc.go
$ ll gow/pkg/mod/github.com/hashicorp/
total 8
dr-x------ 2 clementauger clementauger 4096 22 nov. 20:35 err...@v1.0.0
dr-x------ 2 clementauger clementauger 4096 22 nov. 20:35 go-mul...@v1.0.0
$ ll gow/pkg/mod/github.com/hashicorp/*/*
-r--r--r-- 1 clementauger clementauger 4377 22 nov. 20:35 gow/pkg/mod/github.com/hashicorp/errwrap@v1.0.0/errwrap.go
-r--r--r-- 1 clementauger clementauger 1292 22 nov. 20:35 gow/pkg/mod/github.com/hashicorp/errwrap@v1.0.0/errwrap_test.go
-r--r--r-- 1 clementauger clementauger 36 22 nov. 20:35 gow/pkg/mod/github.com/hashicorp/errwrap@v1.0.0/go.mod
-r--r--r-- 1 clementauger clementauger 15977 22 nov. 20:35 gow/pkg/mod/github.com/hashicorp/errwrap@v1.0.0/LICENSE