#144HoursOfCode D12

Submitted over 3 years ago

(12:47pm - 2:09pm, 7:08pm - 10:15pm)
(Note: I missed one of my hours from the weekend and my lunch hour of coding yesterday, so I went into today 2 hours behind. I got an extra hour in today, so now I'm just 1 behind).

Progress
* The fix of removing the public/assets folder from my blog app seems to have worked
* Successfully parsed JSON form Google Geolocation API with Gabs library
* App collects city and state from user and interpolates it into the Geolocation API request
* Started on interpolating lat/long info into request to DarkSky APi

Thoughts
I've been checking my blog the past few days, and every time I check it the CSS is now rendering properly so I think I've got that issue FINALLY fixed.

This strict typing has been kicking my butt with Golang! But I know it's teaching me to be a better dev so I'll be thankful for these struggles. Currently I'm getting stuck trying to interpolate the lat/long data from Google's API into my request to DarkSky due to an issue with needing to convert the lat/long variables from interfaces into strings. A simple type conversion didn't work for me after several minutes of working with it, so I moved my attention to trying to parse output from the DarkSky API. This'll be important because I want users to be able to request different pieces of that output, depending on what kind of weather data they want. For some reason, I'm getting a type error related to an interface there too even though the process I'm using is almost exactly the same as the successful parsing process I used for the Google API. There very well may be a common link with the interface errors, but I'm out of time for today so maybe fresh eyes the next time I work on it will help. Here's the error I'm getting when trying to parse the JSON from the DarkSky API: panic: interface conversion: interface is nil, not interface {}

From where I started today though, I've completed lots of firsts! First time successfully parsing JSON in go, first time collecting and acting on user input, and first time making API calls to 2 different services in the same application ever! These resources helped me out a ton today:
* https://coderwall.com/p/ns60fq/simply-output-go-html-template-execution-to-strings
* https://stackoverflow.com/questions/44448384/how-remove-n-from-lines-from-golang
* ttps://tutorialedge.net/golang/reading-console-input-golang/
* https://www.socketloop.com/tutorials/golang-interpolating-or-substituting-variables-in-string-examples

In addition to getting the interpolation and parsing working for my DarkSky request & response, I also need to properly organize my app and break out several functions.

For my blog, I also need to update my About page, add my resumé when it's ready, & remove the link to create a new post from the About page.

Commits:
Here are today's commits:
* https://github.com/twoesplease/poncho/commit/9ff6a80ee713bcc9a95098db72461589f3c1c87a
* https://github.com/twoesplease/poncho/commit/9b05e047f413b7bd10ea236cc2214123f5cca6a7

0 Comments

Add a comment: