Programmers switch to Golang development with zero foundation, just read this article (including 30G self-study tutorial notes)

The development of the Go language is getting better and better. Many major companies use Go as the main development language, and many people have started to learn Go and are ready to switch to Go development.

So, how to learn it?

I found that in the Internet age, the difficulty of learning is not that there are no materials, but that there are too many materials, and I don’t know which one to read and where to start.

Therefore, I compiled a Go learning route. This learning route does not win by quantity, but strives to be streamlined. From basic to advanced, from theory to actual combat, it includes the following contents:

  • Getting Started Tutorial
  • Advanced Tutorial
  • book recommendation
  • web development
  • Hands-on project
  • Utilities
  • technical community

1. Getting Started Tutorial

1.1. Go language Chinese website - Go language introductory tutorial

This set of Go language tutorials is easy to understand and easy to understand. It is not only suitable for readers with no foundation to get started quickly, but also suitable for programmers who have worked for many years to check knowledge points.

1.2. Cainiao Tutorial - Go Language Tutorial

This website needs no introduction, as many introductory tutorials for programming languages ​​can be found here. In the process of writing code, if you forget a certain knowledge point, you can also check it here.

1.3. W3Cshcool - Go Tutorial

It is also a comprehensive programming introductory tutorial website, with a lot of information and very basic.

1.4、Go by Example

Lots of code examples, useful when learning the basics. You can refer to this website to write code while reading the theory, the effect will be better.

1.5. Gopher Documentation

It can be said to be a navigation website for Go programming, and it has collected a lot of Go learning materials. Including websites, books, open source libraries, open source projects, etc.

 

2. Advanced tutorial

2.1. mojotv blog

Very good blog, there are many advanced Go articles, as well as other technical articles, worth reading. I tried to find the author information, but couldn't find it.

2.2. Fried fish - Go language design philosophy

Combining the official information and the author's own understanding, the blog of Jianyu Daxie has sorted out a series of articles related to the concept and philosophy of Go language design.

2.3. Faith-oriented programming - Go language design and implementation

Zuo Shen's blog has a lot of content. If you want to become a great god, you must read it.

2.4. Go night reading

This is an open source project organized by many senior Gophers, mainly to interpret the Go source code. And insist on open source, upload relevant resources to GitHub.

 

3. Book recommendation

The book list contains a total of 10 books, divided into 5 for beginners and 5 for advanced. I have read 7 of them, and although I haven't read the other 3, they are recommended more on the Internet.

Although it is divided into entry and advanced, many books contain both parts. When you watch it, you can lay a solid foundation first and then advance to the advanced level according to your own situation.

 Some books are open source and can be read directly online, and some have e-books, you can find the download method on GitHub here  . If conditions permit, it is best to buy genuine ones.

3.1. Getting Started

①, "Go Language Interesting Guide"

This book is a book for Go language beginners, and the content is relatively shallow, which is very suitable for getting started.

The book introduces the knowledge necessary to use the Go language step by step, shows a lot of vivid and interesting examples, and provides a lot of exercises to deepen readers' understanding of the content described in the book.

②, "Go Getting Started Guide"

 

The English name of this book is "The Way to Go", and the author uses his spare time to do translation work. It is open sourced with the authorization of the original author Ivo Balbaert.

③, "Go Language Programming"

This book mainly introduces the features of Go language, and the examples try to use the author's usual practice, rather than a grammar demonstration sample without much practical significance. By making a horizontal comparison with C++ and Java, you can more intuitively see the difference in their design concepts.

The author Xu Shiwei is the former Chief Architect of Jinshan WPS, a former researcher of Shanda Innovation Institute, and is currently a recognized Go language expert in the domestic Go language practice circle. Several authors who participated in the writing of this book are developers of projects actually developed in Go language, and have strong practical experience.

④, "Go Language 101"

It is a programming guide book (Go 1.17 ready) that focuses on Go syntax semantics and runtime-related knowledge points. This book aims to help Go programmers understand the Go language as deeply and comprehensively as possible.

This book also collects many details in Go language and Go programming, some of which are never mentioned in the official documentation.

This book is suitable for both Go beginners and experienced Go programmers.

⑤, "Go Language Programming"

This book is co-written by the author Kernighan and Alan Donovan, director of Google's Go team, and is a guide-level book for learning the Go language. The content is informative and comprehensive, covering all the basic content, and it is worth reading.

3.2 Advanced

①, "Go language combat"

Compared to other technical books, this book is very thin. Obviously, this isn't an all-inclusive book, but it hits the nail on the head.

In the process of reading, my biggest feeling is that many questions that I encountered in the process of reading basic knowledge, and it is difficult to find answers through search engines, have been answered here.

②, "Go Web Programming"

Learning a language is not the goal, but being able to use this language to work and earn money is the goal. Therefore, I have to learn the application of Go in Web programming.

This book was translated by Huang Jianhong. This translator also wrote the book "Redis Design and Implementation". The book analyzes the data structure and design ideas used by Redis in a simple way, which is really excellent.

③, "Go Language Advanced Programming"

Covers advanced topics such as CGO, Go assembly, RPC implementation, web frameworks, distributed systems, and more. There is no strong connection between the chapters in the book. Each chapter is independent knowledge and can be read on demand.

④, "Go Language Study Notes"

The author is Mr. Yuhen, a lecturer at the first GopherChina conference in 2015.

This book is divided into two volumes:

The first volume carefully analyzes the relevant details of the language specification, so that readers can deeply understand the usage methods and precautions of language-related functions.

The second volume makes an in-depth analysis of the runtime source code, and guides readers to thoroughly understand the supporting environment and operating system behind language functions, such as memory allocation, garbage collection, and concurrent scheduling. This book is not suitable for programming beginners, it can be used as a reference for those who have actual programming experience or are working with Go.

⑤, "Analysis of the underlying principles of Go language"

This book uses easy-to-understand language and a large number of pictures to introduce in depth the usage and underlying principles of modules such as Go language compilation, type system, grammatical features, function call specifications, concurrent programming, memory management and garbage collection, and running status monitoring.

For students who want to understand the underlying principles of Go and read the source code, they can read this book, but it is not easy to fully understand the content of the book.

3.3. Book list summary

  1. "The Go Programming Language" --- Alan AA Donovan, Brian W. Coynihan
  2. "Go Language Programming" --- Xu Shiwei
  3. "Go in Action" --- William Kennedy, Brian Ketterson, Eric St. Martin
  4. "Go Language Core Programming" --- Li Wenta
  5. "Go Language Study Notes" --- Rain Trace
  6. "Go Programming Concurrency in Practice" --- Hao Lin
  7. Getting Started with Go
  8. "Go Language Standard Library"
  9. "Go Web Programming"
  10. "Go Language Blog Practice"
  11. "Go Language Study Notes"
  12. "Advanced Programming in Go Language"
  13. 《Effective Go》
  14. "Learning Go" English version => "Learning Go" Chinese version
  15. "Go Command Tutorial"
  16. "Network programming with Go" => Chinese version
  17. 《Practical Cryptography With Go》
  18. 《An Introduction to Programming in Go》
  19. 《Go Bootcamp》
  20. 《Mastering Concurrency in Go》 July 2014 Nathan Kozyra
  21. 《Go Programming Blueprints》 January 23,2015
  22. 《The Go Programming Language》 Published Oct 30, 2015,Not Yet Published
  23. 《Practical Go: Real world advice for writing maintainable Go programs》
  24. "Go Language Bible (Chinese Version)"
  25. "Concurrent Programming in Go Language"
  26. "In-depth analysis of Go"

4. Web Development

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. Also because of its simplicity, reliability, and efficiency, it has the following advantages when using Go language to develop web applications:

  1. simpler
  2. Stronger compiling ability
  3. higher performance
  4. Good IDE support and debugging features
  5. Grammar is simple and easy to use

The following introduces 5 open source web frameworks. The criteria for selecting them are: more stars on GitHub, active maintenance, more use and easy to find information.

4.1、Gin

Project address:  https://github.com/gin-gonic/gin

An HTTP web framework written entirely in Go language, providing a faster and higher performance Go language web development framework.

This framework is easy for beginners to use, and among the web frameworks, stars are the most, and many people use it.

4.2、Terms

Project address:  https://github.com/beego/beego

Beego is an easy-to-use enterprise-level Go application development framework developed by Go language development expert Asta Xie. It has an official website and tutorials in Chinese.

Different from other framework languages, Beego not only provides graphic tutorials, but also video tutorials, which is very friendly to domestic developers.

4.3、Iris

Project address:  https://github.com/kataras/iris

The Iris framework is described on its official website as the fastest web framework for Go development, and a performance comparison between multiple frameworks and multiple languages ​​is given.

If you are choosing a Go language web development framework with good performance, lightweight and easy to use, Iris is a good choice.

4.4、Echo

Project address:  https://github.com/labstack/echo

Echo is a fast HTTP router (zero dynamic memory allocation) and a tiny web framework for Go.

It has a fast HTTP router, supports extended middleware, and also supports static file services, WebSocket, and supports formulating binding functions, formulating corresponding rendering functions, and allowing the use of arbitrary HTML template engines.

4.5、GoFrame

Project address:  https://github.com/gogf/gf

GoFrame is a modular, high-performance, enterprise-level Go-based development framework. GoFrame is not a WEB/RPC framework, but a general-purpose basic development framework. It is an enhanced extension level of the Golang standard library, including common core basic development components.

The advantages are actual combat, modularization, comprehensive documentation, rich modules, high ease of use, strong versatility, and team-oriented.

Overall, this project has comprehensive Chinese documentation and peripheral development libraries, an active issue discussion area, and a good modular design of the project.

These five open source projects have their own advantages and disadvantages. Some have been verified by the market and are widely used; some are rising stars and developing rapidly.

You can choose what you are interested in to learn and use.

5. Hands-on project

After learning the theory, the next step is actual combat and starting to work on projects. In addition to web development, there are many directions to choose from, such as db, cache, im and so on. And as a practice project, it should not be too complicated, otherwise it will not be understood at all, and it will damage confidence and will not achieve the effect of exercise.

Here I have chosen 5 projects. On the whole, the amount of code is not very large, and the difficulty is moderate. And different projects can learn different technical points, you can choose what you are interested in to try.

5.1、id-maker

Project address:  https://github.com/yongxinz/id-maker

A distributed unique ID generation system developed in Go.

The amount of code is small, and the overall difficulty of the project is small. Through this project, you can learn knowledge about httpServer and gRPC.

5.2、cache2go

Project address:  https://github.com/muesli/cache2go

A relatively simple cache library with a small amount of code, suitable for novices to learn. Through this project, you can learn about locks, goroutines and other knowledge.

5.3

Project address:  https://github.com/flower-corp/rosedb

rosedb is a stable, high-performance, fast, embedded kv storage engine that supports multiple data structures, including String, List, Hash, Set, Sorted Set, and the interface name style is similar to Redis.

The project is implemented in pure Golang, and most of the basic knowledge points of the Go language are included. I believe it must be a very good project to learn and consolidate Golang.

In addition, there are some data structure implementations in the code, so you can also learn about data structures at the same time.

5.4、wechat-go

Project address:  https://github.com/songtianyi/wechat-go

This is the Go language implementation of the WeChat web version API, simulating the login/contact/message sending and receiving functions of the WeChat web version, which can completely take over the messages received by WeChat and customize its own sending content.

I think this project is quite interesting. It can be used to operate WeChat and experience more fun of learning.

5.5, gin-vue-admin

Project address:  https://github.com/flipped-aurora/gin-vue-admin

gin-vue-admin is a full-stack background management system that uses gin + vue for extremely fast development. The background uses the gin framework, and the front-end mainly uses vue.

The directory structure of the project is very clear, and the package name is semantic, which can help you learn quickly.

This project also uses some popular Go open source libraries and middleware, such as:

  • gin: the most popular Go language web framework
  • gorm: database operation middleware
  • zap: uber open source log library for Go language
  • redis:kv cache

In addition, this project also has detailed Chinese documents and supporting teaching videos, which are worth learning.

6. Practical tools

As the editor becomes more and more powerful, the functions of some small and beautiful websites have been replaced by the editor, but it still does not prevent me from liking them, and I recommend them to everyone below.

6.1、JSON to Go struct

Website link:  JSON-to-Go: Convert JSON to Go instantly

6.2、YAML to Go struct

网站链接: YAML-to-Go: Convert YAML to Go instantly

6.3、Table to Go struct

Website link:  https://github.com/gohouse/converter

There are two ways to use it, namely calling from the command line and writing Go code.

6.4、Rego

Website link:  http://regoio.herokuapp.com/

Go language regular online test.

6.5、plantUML

Website link:  Dumels

This site analyzes a Go project and generates UML diagrams of interfaces and structures. With this picture, basically you have a basic concept of the overall relationship of the project, and then read the source code, it will be relatively easier.

6.6、Playground

Website link:  Go Playground - The Go Programming Language

Go language code runs online.

7. Technical community

Now, the technical community may see fewer and fewer people, and it is not so active. From my personal experience, the same is true. If you have any questions, you can directly Google it, and basically you will not go to the technical community to check and ask.

Here are a few that I think are pretty good, and you can browse around in your spare time.

Guess you like

Origin blog.csdn.net/Cloud_Native/article/details/128022626