6, GO programming mode: GO GENERATION

In this article, we will learn how to play the code generation of go language. Go language code generation is mainly used to solve the problem of programming genericity. The main problem of generic programming is that static type languages have types. Therefore, relevant algorithms or data processing programs need to be copied because of differ ...

Added by qing on Tue, 08 Feb 2022 16:00:54 +0200

10, GO programming mode: Generic Programming

Version 1.17 of the Go language has been released, which officially supports generics. Although there are some limitations (for example, you can't export generic functions), you can experience it. My "Go programming mode" series finally has real generic programming, and there is no need to use difficult technologies such as reflection ...

Added by mjahkoh on Tue, 08 Feb 2022 09:55:39 +0200

i/o timeout. I hope you don't step into the pit of this net/http package

The article is continuously updated. You can search "growth of golang Xiaobai" on wechat for the first time, and reply to [tutorial] to get a free video tutorial of golang. This article has been included in GitHub github.com/xiaobaiTech/golangFamil... , there are complete test sites and growth routes for large factory interviews. Welc ...

Added by renzaho on Tue, 08 Feb 2022 03:35:45 +0200

A garbage article about Go operating MySQL

I Download MySQL driver Execute the following command: go get - u GitHub com/go-sql-driver/mysql II Connect to the database using MySQL driver First create a database create database go_mysql_test Then establish a connection through the sql package: package main import ( "database/sql" _ "github.com/go-sql-driver/mysql" ) func mai ...

Added by kharbat on Mon, 07 Feb 2022 21:14:30 +0200

[Golang Quick Start] Advanced Syntax: Reflection + Concurrency

Learning Video: 8 Hours Transfer to Golang Engineer This course is very suitable for small partners with certain development experience, push! Golang Advancement reflex Variable Built-in Pair Structure var a string // pair<statictype:string, value:"aceld"> a = "aceld" var allType interface{} // pair<type:string, value:" ...

Added by gmann001 on Mon, 07 Feb 2022 19:54:12 +0200

go specification programming essential tools (code specification and single test)

Preface Good use of tools in go development can greatly facilitate standardized development, the first thing you need to do is to standardize and test. Generally speaking, usage habits are a key gofmt goimports must be used. Go vet golangci-link assists in checking semantics and correcting them.Complete the necessary basic use cases, form-bas ...

Added by loftystew on Mon, 07 Feb 2022 19:17:53 +0200

Go language - basic grammar

Hello,GO! package main // Define package name func main() { print("Hello,Go") } main function points ++No parameter, no return value++The main method must be in the main packagego run main.go can be executedIf the file is not called main Go, you need to go build and then go run Package declaration - package declaration Syntax form: p ...

Added by rohithreddyk on Mon, 07 Feb 2022 10:58:54 +0200

Web is Easy,Let's try Gin

I quick start Download the package of gin: go get GitHub com/gin-gonic/gin The hello world written by gin is as follows: package main import "github.com/gin-gonic/gin" func main() { router := gin.Default() router.GET("/hello", func(context *gin.Context) { // Register a path handler context.Writer.WriteString("Hello!") }) ro ...

Added by bad_gui on Mon, 07 Feb 2022 00:01:26 +0200

1, Go programming mode: slicing, interface, time and performance

Slice First of all, let's discuss Slice, which is called "Slice" in Chinese translation. This thing is not an array in Go language, but a structure. Its definition is as follows: type slice struct { array unsafe.Pointer //Pointer to the array where the data is stored len int //How long is it cap int ...

Added by sillyman on Sun, 06 Feb 2022 21:41:59 +0200

5, GO programming mode: MAP-REDUCE

In this article, we will learn about the three very important operations of map, Reduce and Filter in functional programming. These three operations can make us carry out some data processing very conveniently and flexibly - in most cases, our programs are used to invert data, especially for some business scenarios that need statistics, Map/Red ...

Added by supermerc on Sun, 06 Feb 2022 20:32:39 +0200