As part of RFC 751, changes to executor.Job most likely will break backwards compatibility with Sourcegraph (deserialization errors).
Multiple versions of executor.Job can be supported by using a “wrapper” struct that has an embedded interface. The interface is implemented by every different version of the Job.
As part of RFC 751, changes to
executor.Job
most likely will break backwards compatibility with Sourcegraph (deserialization errors).Multiple versions of
executor.Job
can be supported by using a “wrapper” struct that has an embedded interface. The interface is implemented by every different version of the Job.Take the following example,
With the
JobWrapper
, we can now deserialize multiple different versions of a job by implementing a customUnmarshalJSON
function.Done