Go advanced learning notes

[TOC] Go language principle Basics self-taught Error Error vs Exception Error Type Sentinel Error predefined error value Sentinel errors Be you API Public part. Sentinel errors A dependency is created between the two packages. conclusion: Avoid as much as possible sentinel errors. Error types type MyError struct { Msg string ...

Added by cvincent on Wed, 02 Feb 2022 11:44:52 +0200

goroutine foundation of Go language

1, Introduction to goroutine Foundation goroutine is a coroutine in Golang. It is a micro thread, which consumes less resources than threads. The function of thread is to carry out concurrency or parallelism, and make full use of the resources of computer multi-core. Concurrent multiple tasks run on one cpu, only one task is processed at a cer ...

Added by sheffrem on Wed, 02 Feb 2022 11:22:55 +0200

What are the results of two nil comparisons

background Hello, everyone. I'm asong. I saw a very interesting interview question in an exchange group a few days ago. Today I share it. Let's take a look at this question first: fmt.Println(nil== nil) What is the comparison result of two Nils? true, false, or unable to compile? Let's think first and reveal the answer in the article. Defini ...

Added by toma42 on Wed, 02 Feb 2022 08:27:50 +0200

Introduction to Go language

Install Go environment Installation package download address: https://golang.org/dl/ , it can't be opened https://studygolang.com/dl Download. After the download and installation is completed, you can open Win+R and enter cmd to check whether the installation is successful. If you enter go version successfully and display the version numb ...

Added by ritter on Tue, 01 Feb 2022 09:42:26 +0200

Go slicing and tips (latest version in 2022)

Hello, I'm Taibai. Today I'd like to talk to you about Slice of Go language and some of its skills. Original address (illustrated in the original): mp.weixin.qq.com/s/pNfx7AtXg_SiapW... Welcome to my first official account (which will share Go, micro services, architecture, open source projects, source analysis, etc.): 1 Preface Slicing is ...

Added by nrsh_ram on Tue, 01 Feb 2022 02:36:00 +0200

Go language slices are wiped out. Don't be confused with Java syntax

preface I always want to find out what kind of technical article is a good article? Because it is not easy to write an article that you are willing to read in the future, you can only strive for this goal for the time being. Recently, I started to brush some questions with Go and encountered some detailed problems related to slicing. Here is ...

Added by Buglish on Sun, 30 Jan 2022 19:14:15 +0200

Golang's ORM framework Gorm starts quickly

Gorm quick start Gorm is the ORM framework of Go language, which is characterized by: Full feature ORM (almost all features)Model Association (one to one, one to many, one to many (reverse), many to many, polymorphic Association)Hook (Before/After Create/Save/Update/Delete/Find)PreloadaffairComposite primary keySQL constructorauto migratejour ...

Added by wakenbake on Sat, 29 Jan 2022 15:15:02 +0200

Go Web learning notes (Gin and Gorm)

With the recommendation of my senior, I will use go to develop the back-end! I've gone through the basic grammar of go before. Now I'm learning the Gin and Gorm framework. I'd like to make a record and hope it will be helpful to you. Of course, because I'm a novice to go, I have something wrong to write. Thank you! By the way, here's the basic ...

Added by andrewcb on Sat, 29 Jan 2022 07:45:42 +0200

Go single test series 6 - use of goconvey

This is the fifth in a series of tutorials on Go language unit testing from zero to slip. It introduces how to use gocovey to better write unit tests and make the unit test results more intuitive and visual. In the previous "Go single test series 5 - Monkey piling test", we introduced how to use monkey to pile functions and methods in ...

Added by kryppienation on Sat, 29 Jan 2022 03:21:26 +0200

Iris microservice framework_ golang web Framework_ Full sample Demo

Iris introduction Iris is a framework used to develop web applications in Go language. The framework supports writing once and running with minimum machine power anywhere, such as Android, ios, Linux and Windows. The framework only needs an executable service to run on the platform. Iris framework is familiar to developers with its simple and ...

Added by Xajel on Sat, 29 Jan 2022 00:37:05 +0200