Hacker News new | ask | show | jobs
by Cthulhu_ 1304 days ago
This is the answer. Write a utility instead of get frustrated with the language; be pragmatic. Same with looking for libraries that do something trivial.
1 comments

I’m used to parsing a date time with things like %Y-%m-%d not the asinine way Go does it.
If you're using JetBrains Goland, hit Ctrl+Space when you're writing the date layout in `time.Parse`, and it'll suggest you the regular YYYY, MM, dd etc. placeholders. When you pick one, it types in 2006, 01, 02 magic numbers. Here's a GIF:

https://imgur.com/FyCJZvh

That said, I hate this, all the ways it's opinionated and praised zealously for it as the best thing since sliced bread.