4 ms·
Why does the author use double ticks? As far as I know you use only one. ID string ``json:"id"``
by valevk 11y ago
Why does the author use double ticks? As far as I know you use only one.
ID string ``json:"id"``
- buro9 11y agoThat is an error and would not compile. This code example has not gone through gofmt or been compiled... it is pseudo-Go
- gronnbeck 11y agoWell, that is a typo. I'll fix it =) Thank you!
- unfunco 11y agoYou should definitely run go fmt, at the moment it's rather difficult to read the examples.
- gronnbeck 11y agoI had to anonymize the code a bit and it seems like I messed up doing so in the gist. I am sorry! I will unsure to run it through gofmt the next time. Thank you for the feedback!
- libria 11y agodatadoghq link is broken as well.
- gronnbeck 11y agoAh! Seems like I messed up the markdown. Fixed now. Thank you for your feedback.
- JackuB 11y agoAnd there is "DataDag" once :)
- Huggernaut 11y agoD'ya like DataDags?
- aheim 11y agodagnabbit!
- cronos 11y agoThe code examples are quite non-idiomatic and have lots of issues, to be honest. - constant strings (defined as vars) as return values instead of the standard error type - not formatted - synthetic request's response body not closed - a memory leak - log.Fatal (which results in os.Exit(1) immediately killing the program) for all the non-critical errors - timestamp as a string instead of time.Time in the struct - not re-using http.DefaultClient - 3rd party package with a custom DSL instead of a simple time.Ticker Sorry for the pedantry, but if such code examples live on the internet, newcomers to Go will learn from it (if not blindly copy-paste) and it will spread even further indirectly giving bad reputation to the language. P.S. i do like this idea of continuous integration testing in production, will probably start using it at our company.