Go design pattern (20) - strategy pattern
Strategy mode may be the first mode learned by many students. This mode is really suitable as the opening mode. The main reason is that the mode is simple, pure and does not have many skills, but it well expresses the concept of design mode, so that readers can intuitively feel the benefits of design mode.
The core of policy pattern is to use ...
Added by LexHammer on Fri, 21 Jan 2022 08:22:16 +0200
golang special - simple record map usage and underlying implementation
What is a map
The Map structure exists in many programming languages, including today's protagonist go language. Today, we will analyze the Map in go in several aspects.
In the most popular words, Map is a data structure that obtains value through key. Its underlying storage method is array. The key cannot be repeated during storage. W ...
Added by davestewart on Thu, 20 Jan 2022 13:21:35 +0200
Use Go language to implement a super mini message queue. I do this
The article comes from WeChat official account: Go language circle.Reference link: www.jb51.net/article/231909.htm
Pre knowledge:
go basic grammarThe message queue concept consists of three parts: producer, consumer and queue
objective
I didn't think about the complexity of the implementation. Because time is limited, just mini. To what ex ...
Added by prismstone on Thu, 20 Jan 2022 11:41:14 +0200
Go - how to write the ProtoBuf plug-in?
preface
Last article Go - how to write ProtoBuf plug-in (II) , shared the definition of the "interceptor" plug-in based on "custom options", and then in "HelloWorld The plug-in is used in proto , and finally the plug-in information is obtained in the , golang , code.
Continue to share.
Now that we have the plug-i ...
Added by bskauge on Wed, 19 Jan 2022 11:16:01 +0200
Build dubbo interface test platform with dubbo go
background
http interface test only needs a curl command, but dubbo protocol has no such ready-made interface test tool. Usually, the dubbo console or other platforms in the company will integrate a dubbo interface testing tool.
When calling a dubbo interface, you need to know the service name, method name and parameter args.
For normal call ...
Added by AnnieKay on Tue, 18 Jan 2022 16:59:32 +0200
A brief introduction to action in the Go language
Introduction to Action
The actions of the Go template are the commands embedded in the template, which need to be placed in two braces {{Action}} in the template. We have used an important action before: dot(.). It represents the data passed to the template.
Here is an official list of action s in the Go language where "Arguments&qu ...
Added by pilau on Tue, 18 Jan 2022 12:13:20 +0200
Implementation principle and source code analysis of Golang map
The source code version involved in this article is Go SDK 1.16.1
1. Basic structure of map
Map is a common data structure in Golang. It is essentially a hash table, similar to HashMap in java and dict in Python. It is a data structure that stores key value pairs. A general map contains two main structures:
Array: the values in the arra ...
Added by fasmy98 on Tue, 18 Jan 2022 04:52:16 +0200
Go language introduction sharing
Introduction: the Go language was written by Ken Thompson, Rob Pike and Robert Griesemer. It originated in 2007 and was officially released in 2009. The main goal of Go is to "both the development speed of dynamic languages such as Python and the performance and security of compiled languages such as C/C + +". It aims to reduce the co ...
Added by kmarsh on Mon, 17 Jan 2022 13:25:38 +0200
Understand WebSocket thoroughly
prefaceBefore the emergence of WebSocket, the front-end and back-end interaction usually used Ajax for HTTP API communication. However, if there are projects with real-time requirements, such as PVP battle or push message in chat room or game, the front-end needs to poll the back-end regularly. However, too fast polling may lead to too much pre ...
Added by MrJW on Sun, 16 Jan 2022 22:34:58 +0200
GOlang basic knowledge < II >
Share the learning go website: Foreign websites: https://golang.org go programming website: https://golang.google.cn/ (go packages and functions can be viewed here) Rookie tutorial - Go: green hand Yibai tutorial - Go: Yi Bai tutorial W3c-Go: w3c Geek Go: Geek Go advanced programming GO language library: https://studygolang.com/pkgdoc (comm ...
Added by Ryuujin on Sun, 16 Jan 2022 16:00:11 +0200