Skip to content

Embedding Non-struct types causes panic #944

@9yx

Description

@9yx

I have found no limits to the documentation on the use of variable functions:

type DBF func() *DBConn

type Admin struct {
    *revel.Controller
    DBF
}

When starting an error occurs:

panic: reflect: call of reflect.Value.NumField on func Value

goroutine 1 [running]:
reflect.flag.mustBe(0xd3, 0x19)
        /usr/local/go/src/reflect/value.go:195 +0xb8
reflect.Value.NumField(0x9025a0, 0xc20807b7c8, 0xd3, 0x7faadf3c6b68)
        /usr/local/go/src/reflect/value.go:1117 +0x31
github.com/revel/revel.findControllers(0x7faadf3c6b68, 0x937e60, 0xc2080b84a0, 0x1, 0x1)
        /home/mezencevrv/misc/mygo/src/github.com/revel/revel/controller.go:326 +0x31d
github.com/revel/revel.RegisterController(0x939f20, 0x0, 0xc20808cf00, 0x5, 0x5)
        /home/mezencevrv/misc/mygo/src/github.com/revel/revel/controller.go:400 +0x2c0
main.main()
        /home/mezencevrv/misc/mygo/src/qm-admin/app/tmp/main.go:151 +0x1c2c

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy