Repository: gophergala/learn-Go-the-hard-way
Branch: master
Commit: 05925dc18f69
Files: 4
Total size: 3.1 KB
Directory structure:
gitextract_9_5ihoxy/
├── .gitignore
├── README.md
├── main.go
└── main_test.go
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
================================================
FILE: README.md
================================================
# Learn Go the Hard Way
Originated from the Go Gala hackthon.

## Inspiration:
Before Gala, I was having a talk with my friend, he thought coding is cool, and asked me to teach him to code.
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?
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" -
fill the unfinished functions in the source code.
## Target User
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.
## Features
The key features are the form of learning Go.
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.
In my opinion the best way to learn coding is just coding.
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.
## How to install
This repo has no dependencies, so you can install by typing:
`git clone https://github.com/gophergala/learn-Go-the-hard-way`
or
`go get -u github.com/gophergala/learn-Go-the-hard-way`
## How to use
You should complete the current exercise before you enter the next.
Each exercise is a git tag (from l1 to l10), you can check out the tag, and finish the task with tips.
Run `go test`, if you complete the task, and it will tell you whether you pass the task.
To get the tips, please run `go run main.go`, and follow the tips to modify `main.go`.
Now run `git checkout l1`, let's go!
## Exercises (currently available):
1. warm up, reverse slice.
2. parallel vector sum.
3. cheat rock-paper-scissors.
4. make map function.
5. parallel dynamic programming.
6. tiny webframework 1, managing context.
7. tiny webframework 2, middleware.
8. lexer.
9. cheat sheet.
10. a surprise!
## Members:
[ggaaooppeenngg](https://github.com/ggaaooppeenngg)
## Find Colleague
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!
================================================
FILE: main.go
================================================
package main
func AddPhtoFrame() {
//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
}
func main() {
AddPhtoFrame()
println(`This final exercise,let's add a photo frame for gala logo!
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.
Now edit main.go to complete 'AddPhtoFrame' function,this task has no test,enjoy your trip!`)
}
================================================
FILE: main_test.go
================================================
package main
gitextract_9_5ihoxy/ ├── .gitignore ├── README.md ├── main.go └── main_test.go
SYMBOL INDEX (2 symbols across 1 files)
FILE: main.go
function AddPhtoFrame (line 3) | func AddPhtoFrame() {
function main (line 8) | func main() {
Condensed preview — 4 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3K chars).
[
{
"path": ".gitignore",
"chars": 0,
"preview": ""
},
{
"path": "README.md",
"chars": 2685,
"preview": "# Learn Go the Hard Way\n\nOriginated from the Go Gala hackthon.\n\n\n\n## Inspiration:\n\nBefore Gala, I was h"
},
{
"path": "main.go",
"chars": 508,
"preview": "package main\n\nfunc AddPhtoFrame() {\n\t//TODO:user the res/gophergala.jpg to generate a image and write to res/m.jpg which"
},
{
"path": "main_test.go",
"chars": 13,
"preview": "package main\n"
}
]
About this extraction
This page contains the full source code of the gophergala/learn-Go-the-hard-way GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 4 files (3.1 KB), approximately 900 tokens, and a symbol index with 2 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.