Go basics summary
Go basics summary
Variable declaration
Variables in Go language can only be used after declaration (variables need to be defined in advance) and must be used after declaration (if not applicable, an error will be reported)
Standard statement
var Variable name variable type
example:
var name string
var id int
var isOk bool
Multivariabl ...
Added by lhcpr on Thu, 30 Dec 2021 23:45:53 +0200
GoFrame framework: add Prometheus monitoring Middleware
introduceThrough a complete example, Prometheus monitoring middleware is added to the micro service based on GoFrame framework.What is Prometheus monitoring interceptor / Middleware?The monitoring interceptor will record Prometheus Metrics for each API request.We will use rk-boot To start the micro service of GoFrame framework.Please visit the ...
Added by ltoto on Thu, 30 Dec 2021 21:00:37 +0200
Go Concurrency: goroutine and channel
Go Concurrency: goroutine and channel
I believe you are already familiar with processes and threads. In order to squeeze the performance of multi-core processors, all languages show their power, and Go is no exception. However, Go is somewhat different from other languages, and users need to control and allocate resources themselves.
gor ...
Added by Fribbles on Thu, 30 Dec 2021 16:29:55 +0200
TIDB source code learning
framework
There is on the official website. There is no analysis here. This paper mainly records the SQL part of the source code processing.
entrance
The main function is as follows. All the previous parameters are configured from terror Mustnil (SVR. Run()) enters run here Then go all the way down, through a series of judgments, and fi ...
Added by flashicon on Thu, 30 Dec 2021 13:53:46 +0200
Go language operation database MySQL
connect
The database/sql package in Go language provides a universal interface to ensure SQL or SQL like databases, and does not provide specific database drivers. When using database/sql package, you must inject (at least) one database driver.
Our commonly used databases basically have a complete third-party implementation. For example: MySQ ...
Added by CheesierAngel on Wed, 29 Dec 2021 22:08:16 +0200
Fundamentals of Go language (13)
13, Reflection
13.1 introduction
● reflection refers to the ability to access and modify the program itself during program operation. When the program is compiled, the variable is converted to the memory address, and the variable name will not be written to the executable part by the compiler. While running the program, the program cannot get ...
Added by Venkatesh on Wed, 29 Dec 2021 14:07:41 +0200
Go Quiz: see the underlying principles and precautions of slice from the go interview questions
Interview questionsRecently, the author of Go 101 released 11 Go interview questions, which are very interesting. He plans to write a series to analyze each question in detail. Welcome your attention.You can look at the following question about slice. Through this question, we can have an in-depth understanding of the characteristics and precau ...
Added by Perad on Wed, 29 Dec 2021 03:24:41 +0200
Play with zookeeper using the three core languages Java, Python and Golang
This article video tutorialhttps://www.bilibili.com/vide...Pay attention to the official account and learn more exciting coursesPlay with zookeeper using the three core languages Java, Python and GolangOperate zookeeper using Java Native apiCreate a maven projectCreate a maven projectAdd project dependency<dependencies>
<dependency ...
Added by jakebur01 on Tue, 28 Dec 2021 14:57:44 +0200
How to use Jason's method in Go language?
Encode
Encode an object into JSON data, accept an interface {} object, and return [] byte and error:
func Marshal(v interface{}) ([]byte, error)
Marshal function will recursively traverse the whole object and encode the object according to the member type in turn. The type conversion rules are as follows:
Boolean type converted to JSON
Integ ...
Added by brokencode on Tue, 28 Dec 2021 13:05:42 +0200
Understanding the cache capacity of the pipeline in the Golang process
Author: Regan YueSource: Hang Seng LIGHT cloud communityUnderstanding the cache capacity of the pipeline in the Golang processHello everyone, here is Mr. R, who is striving to become excellent. This time we will continue the Golang series let's Golang together. The content of the blockchain series will continue to be updated next year. The cons ...
Added by baffled_in_UK on Tue, 28 Dec 2021 07:25:22 +0200