francoispqt / gojay

high performance JSON encoder/decoder with stream API for Golang
MIT License
2.11k stars 112 forks source link

Code generation tool not working at all #51

Closed veqryn closed 5 years ago

veqryn commented 6 years ago

go version go version go1.10 windows/amd64

When I run this: gojay -s ./services/xxxxx/models.go -o models_gojay.go I get a file that looks like this:

// Code generated by GoJay. DO NOT EDIT.

package pixel_common 

import "github.com/francoispqt/gojay"

No other content in the file.

When I run this: gojay -s ./services/xxxxx/models.go -t Stuff -o models_gojay.go I get this:

2018/07/23 01:12:20 tag does not exist
2018/07/23 01:12:20 tag does not exist
2018/07/23 01:12:20 tag does not exist
...

Same situation with the package flag: gojay github.com/xxxxx/ecm/services/xxxxx Stuff models_gojay.go gives the empty file. gojay -p github.com/xxxxx/ecm/services/xxxxx -t Stuff -o models_gojay.go gives the tag does not exist errors.

Here is my models.go file:

package xxxxx

type Stuff struct {
    Thing string
}
francoispqt commented 6 years ago

Haven't tested in windows at all as we don't use windows in my company. Will set up a virtual machine to try.

veqryn commented 6 years ago

I tried doing the code generation in a debian linux docker container and still get the tags errors:

root@ecm-pixel-api:/go/src/github.com/ReturnPath/ecm/services/pixel_common# gojay -s models.go -t ElasticSearchPixelRecord -o models_gojay.go
2018/07/23 19:14:54 tag does not exist
2018/07/23 19:14:54 tag does not exist
2018/07/23 19:14:54 tag does not exist
2018/07/23 19:14:54 tag does not exist
....

But at least I get a working file.