My fix for #2528 fixed the bug where Go code was missing the time import. However, it seems a new bug was introduced where in some cases the time import is not appearing at the top of the generated file.
// This file was generated from JSON Schema using quicktype, do not modify it directly.
// To parse and unparse this JSON data, add this code to your project and do:
//
// models, err := UnmarshalModels(bytes)
// bytes, err = models.Marshal()
package generated
import "encoding/json"
func UnmarshalModels(data []byte) (Models, error) {
var r Models
err := json.Unmarshal(data, &r)
return r, err
}
func (r *Models) Marshal() ([]byte, error) {
return json.Marshal(r)
}
import "time"
type Models struct {
TimeRange []time.Time `json:"timeRange,omitempty"`
}
Note the time import is not at the top of the file like the other import. This is a bug that causes the go code to not compile (syntax error).
Looking into a fix for this hopefully will have a Pull Request ready shortly.
My fix for #2528 fixed the bug where Go code was missing the time import. However, it seems a new bug was introduced where in some cases the time import is not appearing at the top of the generated file.
Reproduction steps:
Generated Code:
Note the time import is not at the top of the file like the other import. This is a bug that causes the go code to not compile (syntax error).
Looking into a fix for this hopefully will have a Pull Request ready shortly.