naml: Valast fails at runtime with type pointers

Write now the type pointer generation is failing (at runtime!)

panic: interface conversion: interface {} is *int, not *int32

goroutine 1 [running]:
github.com/naml-examples/simple.(*App).Install(0xc000391200, 0xc000508000, 0x0, 0xa)
        /home/nova/src/tests/app.go:86 +0xed9
github.com/kris-nova/naml.Install(0x1afcaf0, 0xc000391200, 0xc0004a3bd0, 0x0)
        /home/nova/go/pkg/mod/github.com/kris-nova/naml@v0.2.6/cmd.go:386 +0xc7
github.com/kris-nova/naml.RunCommandLineWithOptions.func2(0xc0004d2000, 0x1, 0x1)
        /home/nova/go/pkg/mod/github.com/kris-nova/naml@v0.2.6/cmd.go:160 +0x39f
github.com/urfave/cli/v2.(*Command).Run(0xc000391440, 0xc0003fdf40, 0x0, 0x0)
        /home/nova/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:163 +0x4dd
github.com/urfave/cli/v2.(*App).RunContext(0xc00025bd40, 0x1afc930, 0xc00019a010, 0xc0001a4000, 0x2, 0x2, 0x0, 0x0)
        /home/nova/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:313 +0x810
github.com/urfave/cli/v2.(*App).Run(...)
        /home/nova/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224
github.com/kris-nova/naml.RunCommandLineWithOptions(0x1afcaf0, 0xc000391200)
        /home/nova/go/pkg/mod/github.com/kris-nova/naml@v0.2.6/cmd.go:316 +0xf2b
github.com/kris-nova/naml.RunCommandLine(...)
        /home/nova/go/pkg/mod/github.com/kris-nova/naml@v0.2.6/cmd.go:51
main.main()
        /home/nova/src/tests/cmd/main.go:42 +0xa5

Looks like this is the culprit

			Replicas: valast.Addr(1).(*int32),

We should fix Valast to do something like this

			Replicas: valast.Addr(int32(1)).(*int32),

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

Reading this made me smile - so happy to enable this conversation with the naml project - ill be following along closely

Oh cool, I know Beyang and Quinn from before they started sourcegraph. They are fun to work with. I didn’t realize the connection here. Good stuff!

Just wanted to say thanks for finding these bugs 😃 Happy to see more folks getting use out of these packages.

I left some feedback on the PRs, just let me know if any of this exceeds your time budget for contributing - I’m happy to get more involved in fixing these issues if needed

BTW, interesting stuff with NAML, I’ll be keeping this project in mind - maybe some interesting ways we could use it at my work @sourcegraph 😃

go for it!!