Skip to content
New issue

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

跑不起来 #9

Open
chenyinghong opened this issue Jul 5, 2022 · 2 comments
Open

跑不起来 #9

chenyinghong opened this issue Jul 5, 2022 · 2 comments

Comments

@chenyinghong
Copy link

[ERRO] http: panic serving [::1]:51019: exception recovered: implement not found for interface IView, forgot register?
goroutine 41 [running]:
net/http.(conn).serve.func1()
C:/Program Files/Go/src/net/http/server.go:1825 +0xbf
panic({0xc71120, 0xc002dfd4a0})
C:/Program Files/Go/src/runtime/panic.go:844 +0x258
github.com/gogf/gf/v2/net/ghttp.niceCallFunc.func1()
C:/Users/
/go/pkg/mod/github.com/gogf/gf/[email protected]/net/ghttp/ghttp_func.go:48 +0x2c8
panic({0xbca7e0, 0xf8d390})
C:/Program Files/Go/src/runtime/panic.go:838 +0x207
focus-single/internal/service.View(...)
C:/Users/
/GolandProjects/focus-single/internal/service/view.go:28
focus-single/internal/cmd.glob..func1.5(0x7)
C:/Users/
/GolandProjects/focus-single/internal/cmd/cmd.go:67 +0xba
github.com/gogf/gf/v2/net/ghttp.(Server).ServeHTTP.func2()
C:/Users/
/go/pkg/mod/github.com/gogf/gf/[email protected]/net/ghttp/ghttp_server_handler.go:161 +0x24
github.com/gogf/gf/v2/net/ghttp.niceCallFunc(0xc0003d4000?)
C:/Users/*/go/pkg/mod/github.com/gogf/gf/[email protected]/net/ghttp/ghttp_func.go:55 +0x3e
github.com/gogf/gf/v2/net/ghttp.(Server).ServeHTTP(0xc0003d4000, {0xf93490?, 0xc0000ce0e0}, 0xc00029a300)
C:/Users/
/go/pkg/mod/github.com/gogf/gf/[email protected]/net/ghttp/ghttp_server_handler.go:160 +0x55e
net/http.HandlerFunc.ServeHTTP(0x0?, {0xf93490?, 0xc0000ce0e0?}, 0xc000058c00?)
C:/Program Files/Go/src/net/http/server.go:2084 +0x2f
net/http.serverHandler.ServeHTTP({0xc002dd9fb0?}, {0xf93490, 0xc0000ce0e0}, 0xc00029a300)
C:/Program Files/Go/src/net/http/server.go:2916 +0x43b
net/http.(*conn).serve(0xc002e400a0, {0xf939b8, 0xc00068e1e0})
C:/Program Files/Go/src/net/http/server.go:1966 +0x5d7
created by net/http.(*Server).Serve
C:/Program Files/Go/src/net/http/server.go:3071 +0x4db
Stack:

  1. github.com/gogf/gf/v2/net/ghttp.niceCallFunc.func1
    C:/Users/****/go/pkg/mod/github.com/gogf/gf/[email protected]/net/ghttp/ghttp_func.go:48
  2. focus-single/internal/service.View
    C:/Users/****/GolandProjects/focus-single/internal/service/view.go:28
  3. focus-single/internal/cmd.glob..func1.5
    C:/Users/****/GolandProjects/focus-single/internal/cmd/cmd.go:67
  4. github.com/gogf/gf/v2/net/ghttp.(Server).ServeHTTP.func2
    C:/Users/
    ***/go/pkg/mod/github.com/gogf/gf/[email protected]/net/ghttp/ghttp_server_handler.go:161
  5. github.com/gogf/gf/v2/net/ghttp.niceCallFunc
    C:/Users/****/go/pkg/mod/github.com/gogf/gf/[email protected]/net/ghttp/ghttp_func.go:55
  6. github.com/gogf/gf/v2/net/ghttp.(Server).ServeHTTP
    C:/Users/
    ***/go/pkg/mod/github.com/gogf/gf/[email protected]/net/ghttp/ghttp_server_handler.go:160
@daydayup345
Copy link

logic/view/view.go 少了这段代码。

func init() {
service.RegisterView(New())
}

main.go 也要引入 _ "github.com/gogf/gf/contrib/drivers/mysql/v2"

@chenyinghong
Copy link
Author

确实是view 没有注册的原因,翻了半天都没翻出来

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants