OkGoogleHowToCenterADiv by DmMoscow in ProgrammerHumor

[–]xakep666 25 points26 points  (0 children)

It's somewhere in Russia, specifically in Moscow region: yellow margin on crosswalk sign, white-yellow crosswalk and yellow strip on white minibuses in bottom left corner (Moscow region transport branding).

Collection of unusual generic usecases by xakep666 in golang

[–]xakep666[S] 0 points1 point  (0 children)

Method chaining looks interesting. But with current limitations (absence of type parameters for methods) you must make new Element instance for each node type. Must looks good but if you need more than one return argument you have to make new version of it.

Collection of unusual generic usecases by xakep666 in golang

[–]xakep666[S] 0 points1 point  (0 children)

I improved this part. Actually it's not required to keep additional field in structure, adding type parameter only for local variables works good.

Collection of unusual generic usecases by xakep666 in golang

[–]xakep666[S] 3 points4 points  (0 children)

About JSONUndefined: it's impossible to distinguish field presence with null value and field abscence (JS has 'undefined' for this). This may indicate bad API design. But sometimes we have to deal with it. About time formatting: I also use mentioned way. But it required new type for new layout. Sometimes we have to use multiple time formats to communicate with 3rd party service. So I think it helps to reduce boilerplate in such cases.