You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, sorry for the delay on this one... I’m currently taking a break from open source work and hiking across Nepal for five months...
What exactly are you trying to do here? The parameter of the LitFunc method should be a function that returns one of the types that Lit accepts - e.g. bool, string, int, complex128, float64, float32, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, uintptr and complex64
`type APIparameters struct {
PathParam []pathParameters
Host string
Security string
}
var api APIparameters
api.Host = "api host"
group.List(Id("request"), Id("err")).Op(":=").Id("http").Dot("NewRequest").Call(Id("method"),LitFunc(func() interface{} { return Lit(api.Host).Id("endpoint") }), Id("body"))
There is an error when concatinating LitFunc(func() interface{} { return Lit(api.Host).Id("endpoint") })
panic: unsupported type for literal: *jen.Statement
goroutine 1 [running]:
github.com/dave/jennifer/jen.token.render(0x1184c8e, 0x7, 0x11827a0, 0xc0000db0e0, 0xc0000c80a0, 0x11b4160, 0xc0000c0750, 0xc0000db0c0, 0xc0000d75b8, 0x1041959)
/Users/nartay/go/src/github.com/dave/jennifer/jen/tokens.go:64 +0xed4
github.com/dave/jennifer/jen.(*Statement).render(0xc0000db0c0, 0xc0000c80a0, 0x11b4160, 0xc0000c0750, 0x0, 0x0, 0x0)
/Users/nartay/go/src/github.com/dave/jennifer/jen/statement.go:64 +0xcb
github.com/dave/jennifer/jen.(*Group).renderItems(0xc0000966c0, 0xc0000c80a0, 0x11b4160, 0xc0000c0750, 0x1, 0x0, 0x0)
/Users/nartay/go/src/github.com/dave/jennifer/jen/group.go:110 +0x18a
github.com/dave/jennifer/jen.(*Group).render(0xc0000966c0, 0xc0000c80a0, 0x11b4160, 0xc0000c0750, 0xc0000dafc0, 0x0, 0x0)
/Users/nartay/go/src/github.com/dave/jennifer/jen/group.go:53 +0x84
github.com/dave/jennifer/jen.(*Statement).render(0xc0000dafc0, 0xc0000c80a0, 0x11b4160, 0xc0000c0750, 0x0, 0x0, 0x0)
/Users/nartay/go/src/github.com/dave/jennifer/jen/statement.go:64 +0xcb
github.com/dave/jennifer/jen.(*Group).renderItems(0xc0000964e0, 0xc0000c80a0, 0x11b4160, 0xc0000c0750, 0x1, 0x0, 0x0)
/Users/nartay/go/src/github.com/dave/jennifer/jen/group.go:110 +0x18a
github.com/dave/jennifer/jen.(*Group).render(0xc0000964e0, 0xc0000c80a0, 0x11b4160, 0xc0000c0750, 0xc0000da500, 0x0, 0x0)
/Users/nartay/go/src/github.com/dave/jennifer/jen/group.go:53 +0x84
github.com/dave/jennifer/jen.(*Statement).render(0xc0000da500, 0xc0000c80a0, 0x11b4160, 0xc0000c0750, 0x0, 0x0, 0x0)
/Users/nartay/go/src/github.com/dave/jennifer/jen/statement.go:64 +0xcb
github.com/dave/jennifer/jen.(*Group).renderItems(0xc0000960c0, 0xc0000c80a0, 0x11b4160, 0xc0000c0750, 0x1167a80, 0xc0000d0c01, 0xc0000c0750)
/Users/nartay/go/src/github.com/dave/jennifer/jen/group.go:110 +0x18a
github.com/dave/jennifer/jen.(*Group).render(0xc0000960c0, 0xc0000c80a0, 0x11b4160, 0xc0000c0750, 0x0, 0xc0000d09d0, 0xc0000c05d0)
/Users/nartay/go/src/github.com/dave/jennifer/jen/group.go:53 +0x84
github.com/dave/jennifer/jen.(*File).Render(0xc0000c80a0, 0x11b4160, 0xc0000c0720, 0x4, 0x20)
/Users/nartay/go/src/github.com/dave/jennifer/jen/jen.go:36 +0x82
github.com/dave/jennifer/jen.(*File).Save(0xc0000c80a0, 0x1184c9c, 0x7, 0x2, 0x3)
/Users/nartay/go/src/github.com/dave/jennifer/jen/jen.go:24 +0x5a
main.main()
/Users/nartay/Desktop/job/code_generate/readingJSON/readingJSON.go:130 +0x1e8f
exit status 2
`
The text was updated successfully, but these errors were encountered: