Adam,

In Go, it's usual to hide any ugliness in a function. For example,

https://play.golang.org/p/cfj8NntLHAO

Peter

On Thursday, August 30, 2018 at 7:21:33 PM UTC-4, skirmish wrote:
>
> In example code here; https://play.golang.org/p/4P2nH_KE8uu
>
> I'm trying to parse a date time string of the form 2015-09-09 15:21:08,431 
> but 
> using the format of 2006-01-02 15:04:05,999 (among many others that I've 
> tried) which I'd expect to work, the time.Parse doesn't want to take the 
> format. Looking through time.Parse, it seems it doesn't ever want to accept 
> a comma before millis, is this true? For now, I'm using a strings.Replace 
> to get rid of the comma, but it just feels bad.
>
> I feel like I'm doing it wrong, and as ever I can't change the app 
> generating the data I'm parsing.
>
> --adam
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to