(input io.Reader)
| 189 | } |
| 190 | |
| 191 | func readFile(input io.Reader) ([]byte, error) { |
| 192 | buf := bytes.NewBuffer(nil) |
| 193 | _, err := io.Copy(buf, input) |
| 194 | if err != nil { |
| 195 | return []byte{}, nil |
| 196 | } |
| 197 | return buf.Bytes(), nil |
| 198 | } |
| 199 | |
| 200 | // Generate a struct definition given a JSON string representation of an object and a name structName. |
| 201 | func Generate(input io.Reader, parser Parser, structName, pkgName string, tags []string, subStruct bool, convertFloats bool) ([]byte, error) { |