Giter VIP home page Giter VIP logo

gophercises's Introduction

gophercises

These are my solutions for Jon Calhoun's gophercises

Exercise 1: Quiz (solution)

Completed parts 1 and 2, as well as both bonus tasks. I was already sold on Go's concurrency abstraction but writing this drove home how powerful it could be. I'm very pleased with the simplicity, although the stupid issue with the random seed is driving me crazy. For some reason I keep getting the same value out of time.Now() on my Windows 10 system. I'm still a little unsure on how best to handle command line flags. The flags module is great for handling the parsing, but I feel like I'm using it slightly wrong...

Exercise 2: URL Shortener (solution)

I mostly solved the problem. YAML is easy so I ignored that. Overall, this solution is on the way to something more complicated and feature complete, so I think I'll loop back to it after doing some more exercises. TODOs:

  • Investigate building a full webapp with Buffalo

Fairly simple one. The templating library is a bit odd, but not terrible to work with. TODOs:

  • Investigate using pkger for embedding the template files in the binary
  • Make it prettier
  • CLI version

XML is the worst ๐Ÿ˜– I got the href extraction working, don't really feel like doing the text extraction. The testing module is cool, but I can see why there are frameworks built on top of it. No one wants to write the standard set of equality operations required. TODOs:

  • Refactor the recursive algorithms to use goroutines
  • Do the text extraction
  • Try a testing framework like Testify or maybe a BDD framework if I'm feeling fancy

Exercise 5: Sitemap Builder

Well if the point of #4 was just to build an href extractor, I think I might be ok with where I left it :stuck_out_tongue_closed_eyes:. I'm going to skip this one for the moment and come back when I want to wrangle with XML.

Exercise 6: HackerRank

Huh well I guess this counts as an exercise. Solutions:

Excercise 7: TODO List (solution)

Oh sweet this exercise (despite it's non-obvious name) is exactly what I wanted. I wanted to fiddle with cobra and BoltDB (I'm using the etcd fork since the original isn't being updated and I like etcd).

gophercises's People

Contributors

skycoop avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.