{"action":"created","issue":{"url":"https://api.github.com/repos/pquerna/ffjson/issues/147","labels_url":"https://api.github.com/repos/pquerna/ffjson/issues/147/labels{/name}","comments_url":"https://api.github.com/repos/pquerna/ffjson/issues/147/comments","events_url":"https://api.github.com/repos/pquerna/ffjson/issues/147/events","html_url":"https://github.com/pquerna/ffjson/issues/147","id":96067184,"number":147,"title":"Bad code generated for arrays","user":{"login":"ErikDubbelboer","id":522870,"avatar_url":"https://avatars.githubusercontent.com/u/522870?v=3","gravatar_id":"","url":"https://api.github.com/users/ErikDubbelboer","html_url":"https://github.com/ErikDubbelboer","followers_url":"https://api.github.com/users/ErikDubbelboer/followers","following_url":"https://api.github.com/users/ErikDubbelboer/following{/other_user}","gists_url":"https://api.github.com/users/ErikDubbelboer/gists{/gist_id}","starred_url":"https://api.github.com/users/ErikDubbelboer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErikDubbelboer/subscriptions","organizations_url":"https://api.github.com/users/ErikDubbelboer/orgs","repos_url":"https://api.github.com/users/ErikDubbelboer/repos","events_url":"https://api.github.com/users/ErikDubbelboer/events{/privacy}","received_events_url":"https://api.github.com/users/ErikDubbelboer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-20T13:43:49Z","updated_at":"2015-11-06T21:10:39Z","closed_at":null,"body":"ffjson doesn't generate code for structs containing byte arrays (not slices).\r\n\r\n```go\r\npackage main\r\n\r\ntype Bug struct {\r\n        F [16]byte\r\n}\r\n\r\nfunc main() {\r\n}\r\n```\r\n\r\n```bash\r\n$ ffjson main.go\r\n$ go build\r\n# github.com/erikdubbelboer/ffjsonbug\r\n./main_ffjson.go:171: cannot use nil as type [16]byte in assignment\r\n./main_ffjson.go:174: cannot use make([]uint8, 0) (type []uint8) as type [16]byte in assignment\r\n./main_ffjson.go:226: first argument to append must be slice; have [16]byte\r\n```\r\n\r\nIt looks like it treats arrays the same as slices which obviously doesn't work."},"comment":{"url":"https://api.github.com/repos/pquerna/ffjson/issues/comments/154542244","html_url":"https://github.com/pquerna/ffjson/issues/147#issuecomment-154542244","issue_url":"https://api.github.com/repos/pquerna/ffjson/issues/147","id":154542244,"user":{"login":"sergeylanzman","id":9318209,"avatar_url":"https://avatars.githubusercontent.com/u/9318209?v=3","gravatar_id":"","url":"https://api.github.com/users/sergeylanzman","html_url":"https://github.com/sergeylanzman","followers_url":"https://api.github.com/users/sergeylanzman/followers","following_url":"https://api.github.com/users/sergeylanzman/following{/other_user}","gists_url":"https://api.github.com/users/sergeylanzman/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeylanzman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeylanzman/subscriptions","organizations_url":"https://api.github.com/users/sergeylanzman/orgs","repos_url":"https://api.github.com/users/sergeylanzman/repos","events_url":"https://api.github.com/users/sergeylanzman/events{/privacy}","received_events_url":"https://api.github.com/users/sergeylanzman/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T21:10:39Z","updated_at":"2015-11-06T21:10:39Z","body":"I have same error\r\n```\r\ntype a struct{\r\n....\r\nLocation  [2]float64\r\n...\r\n}\r\ncannot use nil as type [2]float64 in assignment\r\ncannot use make([]float64, 0) (type []float64) as type [2]float64 in assignment\r\nfirst argument to append must be slice; have [2]float64\r\n```\r\n\r\nerror in generate code here\r\n```\r\nif tok == fflib.FFTok_null {\r\n\t\t\tuj.Location = nil\r\n\t\t} else {\r\n\r\n\t\t\tuj.Location = make([]float64, 0)\r\n```"}}