You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"funcUnmarshalModels(data []byte) (Models, error) {
varrModelserr:=json.Unmarshal(data, &r)
returnr, err
}
func (r*Models) Marshal() ([]byte, error) {
returnjson.Marshal(r)
}
import"time"typeModelsstruct {
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: