Git Commit History: Github
When I started this challenge I had already spent a bit of time getting to know the
net/http package, so I didn’t find it especially difficult, but I enjoyed the chance to practice with opening and reading files, specifically YAML and JSON files.
Unmarshaling JSON && YAML
Not having taken computer science in school I had no idea what marshaling was; I first saw the terms
unmarshal when starting with Go.
Read more about marshaling here.
Here’s how you transform or
unmarshal yaml to a Go struct:
For this challenge I prefered to use an anonymous struct, but you could define it if you needed it elsewhere.
Keeping It Simple?
As noted in my commit message I prefered to focus my code on creating different parsers that appended new redirects a master redirect map -
map[string]string rather than creating
parsers AND buildling separate
maps to be used in distinct
I suppose it’s a small, maybe unimportant, difference, but this approach suits my brain better.