On Mon, Feb 19, 2018 at 5:14 PM, Doğan Kurt wrote:
> Hi Burak,
>
> The example objects are very simplified. In real code, there are many more
> object types and some of them looks exactly same. For instance;
>
> type chromeHomepage struct {
> Url string
> File string
> }
The core issue seems to be that that round-tripping via json looses
information i.e. type of serialized record.
You solved it by embedding type as field of the record, which works.
You could embed type implicitly.
One way to do it is to use a separate file for each type. The type is
Hi Burak,
The example objects are very simplified. In real code, there are many more
object types and some of them looks exactly same. For instance;
type chromeHomepage struct {
Url string
File string
}
type firefoxHomepage struct {
Url string
File string
}
They look exactly same in the
On Mon, Feb 19, 2018 at 4:45 PM, Doğan Kurt wrote:
> Hi great Go community. Sorry it's a long question, but i would really
> appreciate some guidance.
>
>
>
>
>
> Let's say i have two different objects, browser and executable that
> implement
Hi great Go community. Sorry it's a long question, but i would really
appreciate some guidance.
Let's say i have two different objects, browser and executable that
implement ScanCleaner interface.
type ScanCleaner interface {
scan()
clean()
}
type browser struct {
Name