├── .gitignore ├── main_test.go ├── res ├── m.jpg └── gophergala.jpg ├── main.go └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /main_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | -------------------------------------------------------------------------------- /res/m.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gophergala/learn-Go-the-hard-way/HEAD/res/m.jpg -------------------------------------------------------------------------------- /res/gophergala.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gophergala/learn-Go-the-hard-way/HEAD/res/gophergala.jpg -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func AddPhtoFrame() { 4 | //TODO:user the res/gophergala.jpg to generate a image and write to res/m.jpg which is similar to like the logo in the README.md 5 | 6 | } 7 | 8 | func main() { 9 | AddPhtoFrame() 10 | println(`This final exercise,let's add a photo frame for gala logo! 11 | You should use image package to generate a new image from the gala logo(which is stored in res/gophergala.jpg,and makes it like the res/m.jpg. 12 | Now edit main.go to complete 'AddPhtoFrame' function,this task has no test,enjoy your trip!`) 13 | } 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Learn Go the Hard Way 2 | 3 | Originated from the Go Gala hackthon. 4 | 5 | ![img](res/m.jpg) 6 | 7 | ## Inspiration: 8 | 9 | Before Gala, I was having a talk with my friend, he thought coding is cool, and asked me to teach him to code. 10 | At that time the idea came to my mind - How about write a open repository for gophers to learn how to code Go code by practice? 11 | 12 | I got the name "Learn Go the Hard Way" with the inspiration of ["Learn Python the Hard Way"](http://learnpythonthehardway.org/), and decided to use the form of "Go tour" - 13 | fill the unfinished functions in the source code. 14 | 15 | ## Target User 16 | 17 | The target users are the gophers who had went through the online documents and tutorials like [Effective Go](https://golang.org/doc/effective_go.html), [A Tour of Go](https://tour.golang.org/welcome/1), and [build-Go-web-applications](https://github.com/astaxie/build-web-application-with-golang), assuming the users have basic understanding about Go and want to get something to do with the features of Go. 18 | 19 | ## Features 20 | 21 | The key features are the form of learning Go. 22 | All the tasks are challenging, and most come from the real open libraries as well as relevant papers or talks, however not difficult to complete. It will help you understand main parts of these works instead of browsing the huge code. 23 | 24 | In my opinion the best way to learn coding is just coding. 25 | 26 | There are currently 10 exercises, those works were done during the weekend of hackthon, so they are not seemingly that perfect, but I am sure, you will gain a lot if you finish the tasks. 27 | 28 | ## How to install 29 | 30 | This repo has no dependencies, so you can install by typing: 31 | 32 | `git clone https://github.com/gophergala/learn-Go-the-hard-way` 33 | 34 | or 35 | 36 | `go get -u github.com/gophergala/learn-Go-the-hard-way` 37 | 38 | ## How to use 39 | 40 | You should complete the current exercise before you enter the next. 41 | 42 | Each exercise is a git tag (from l1 to l10), you can check out the tag, and finish the task with tips. 43 | 44 | Run `go test`, if you complete the task, and it will tell you whether you pass the task. 45 | 46 | To get the tips, please run `go run main.go`, and follow the tips to modify `main.go`. 47 | 48 | Now run `git checkout l1`, let's go! 49 | 50 | ## Exercises (currently available): 51 | 52 | 1. warm up, reverse slice. 53 | 2. parallel vector sum. 54 | 3. cheat rock-paper-scissors. 55 | 4. make map function. 56 | 5. parallel dynamic programming. 57 | 6. tiny webframework 1, managing context. 58 | 7. tiny webframework 2, middleware. 59 | 8. lexer. 60 | 9. cheat sheet. 61 | 10. a surprise! 62 | 63 | ## Members: 64 | 65 | [ggaaooppeenngg](https://github.com/ggaaooppeenngg) 66 | 67 | 68 | ## Find Colleague 69 | 70 | I am currently workinng at [kesci](https://www.kesci.com/about/team), if you are interested in Kubernetes and machine learning infra, please contact me! 71 | --------------------------------------------------------------------------------