CLI panics if result type has multiple views
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 583
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 15
Description
I have an example [here](https://github.com/SM43/user-goa).
If you run the service and invoke the API using CLI.
```
./user-cli user get
```
this returns
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x77205b]
goroutine 1 [running]:
github.com/sm43/user-goa/gen/http/user/client.unmarshalCompanyResponseBodyToUserviewsCompanyView(...)
/home/smukhade/go/src/github.com/sm43/user-goa/gen/http/user/client/encode_decode.go:83
github.com/sm43/user-goa/gen/http/user/client.NewGetUserOK(0xc000012090, 0x7991c0)
/home/smukhade/go/src/github.com/sm43/user-goa/gen/http/user/client/types.go:45 +0x8b
github.com/sm43/user-goa/gen/http/user/client.DecodeGetResponse.func1(0xc000076000, 0x0, 0x0, 0x0, 0x0)
/home/smukhade/go/src/github.com/sm43/user-goa/gen/http/user/client/encode_decode.go:64 +0x2e9
github.com/sm43/user-goa/gen/http/user/client.(*Client).Get.func1(0x8c3ec0, 0xc0000a0000, 0x0, 0x0, 0x1e, 0x0, 0xc0000aac00, 0x0)
/home/smukhade/go/src/github.com/sm43/user-goa/gen/http/user/client/client.go:67 +0x120
main.main()
/home/smukhade/go/src/github.com/sm43/user-goa/cmd/user-cli/main.go:82 +0x53f
```
So, there are 3 cases I have created, the [3rd](https://github.com/SM43/user-goa/blob/39231b9548e65313a056af28009368814b20e217/user.go#L53) one seems to be breaking.
HTTP response are correct but in CLI it breaks.
cc @raphael
Contributor guide
Assessment
This issue has not been assessed yet.