We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go version
$ go version go version go1.12.1 darwin/amd64
yes
go env
$ go env GOARCH="amd64" GOBIN="" GOCACHE="/Users/mj/Library/Caches/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/mj/go" GOPROXY="https://goproxy.io" GORACE="" GOROOT="/usr/local/Cellar/go/1.12.1/libexec" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.12.1/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" 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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/xb/dsd0_2b92x7bsl92xlzj6fbm0000gn/T/go-build222988675=/tmp/go-build -gno-record-gcc-switches -fno-common"
i want to RegisterViewPath in sub project, see this link
admin.RegisterViewPath("github.com/qor/admin/views")
this works when i don't use go mod (only go get in project root)
but if i use go.mod, when i run go run main.go in qor-example(import qor/admin)
go run main.go
i will get panic error,
2019/06/02 13:03:26 "GET http://localhost:7000/admin HTTP/1.1" from [::1]:57001 - panic: runtime error: invalid memory address or nil pointer dereference
because templates can't be found.
i know go mod is stored in $GOPATH/pkg/github.com/qor/admin@<hash_version>, how can i get that path in code ?
$GOPATH/pkg/github.com/qor/admin@<hash_version>
and how do i the project is running in go mod mode, because i don't want to break that.
in short, i want to add mod support like this
if (RUNNING_IN_GO_MOD_MODE) { admin.RegisterViewPath("$GOPATH/pkg/mod/github.com/qor/admin@<hash_version>/views") } else { admin.RegisterViewPath("github.com/qor/admin/views") }
The text was updated successfully, but these errors were encountered:
There is no programmatic way to do this today. See #3035 for a related feature request.
Sorry, something went wrong.
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
What did you see instead?
What i want to do ?
i want to RegisterViewPath in sub project, see this link
this works when i don't use go mod (only go get in project root)
but if i use go.mod, when i run
go run main.go
in qor-example(import qor/admin)i will get panic error,
because templates can't be found.
i know go mod is stored in
$GOPATH/pkg/github.com/qor/admin@<hash_version>
, how can i get that path in code ?and how do i the project is running in go mod mode, because i don't want to break that.
in short, i want to add mod support like this
The text was updated successfully, but these errors were encountered: