cmd icon indicating copy to clipboard operation
cmd copied to clipboard

support go modules, panic: runtime error: invalid memory address or nil pointer dereference

Open lenghan4real opened this issue 3 years ago • 1 comments

go mod with dependency like golang.org/x/unix

[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x11d225d]

goroutine 59 [running]: go/ast.Walk(0x16aca80, 0xc010629260, 0x16afa60, 0x0) /Users/han/.gvm/gos/go1.13.5/src/go/ast/walk.go:224 +0x1b4d go/ast.Inspect(...) /Users/han/.gvm/gos/go1.13.5/src/go/ast/walk.go:385 github.com/revel/cmd/parser2.(*SourceInfoProcessor).getValidation(0xc000010040, 0xc0172e4ff0, 0xc013db7000, 0xc014a0c940) /workspace/revel_cmd/parser2/source_info_processor.go:114 +0x15f

lenghan4real avatar Aug 03 '20 14:08 lenghan4real

Can you give a short example? I tried a controller like this and was able to compile without issues

package controllers

import (
	"github.com/revel/revel"
	"golang.org/x/sys/unix"
	"os"
)

type App struct {
	*revel.Controller
}

func (c App) Index() revel.Result {
	unix.Exec("/bin/ls", []string{"ls", "-al"}, os.Environ())
	return c.Render()
}

notzippy avatar Aug 07 '20 14:08 notzippy