hi,

I have some weird permissions set on my module files after i run go get on 
my project.

please check my session

[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

It also triggers a bug when i try to load that package using x/go/loader

$ 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/tools@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

the conf is standard, where dst="."

        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()
        }

go.mod used to work well, what's wrong ?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/1f704570-ae81-47b6-99a9-6d80bc9d5406%40googlegroups.com.

Reply via email to