Hand golang basic data structure and algorithm hash table

Hand golang basic data structure and algorithm hash table origin Recently, I read < < my first algorithm book > > ([Japan] Ishida Baohui; Miyazaki Xiuyi) this series of notes is intended to be practiced by golang Hashtable The hash table stores keys( key)Sum value( value)Composed data. In the hash table, we can use the hash fun ...

Posted by Bladescope on Mon, 18 Apr 2022 06:37:27 +0300

Golang design pattern in Kubernetes

With Kubernetes becoming the de facto standard in the field of container choreography, Golang is more and more used in cloud native. Today, we follow the steps of K8s and learn which classic design patterns are used in K8s. Create mode As the name suggests, the creation pattern provides an object creation mechanism, encapsulates the internal ...

Posted by wwfc_barmy_army on Mon, 18 Apr 2022 06:34:22 +0300

Deep understanding of the memory allocation and execution process of defer

defer performance The release of the official version of go 1.13 has improved the performance of defer, claiming to improve the performance by 30% for defer scenarios. This release improves performance of most uses of defer by 30%. Before go 1.13, only the defer statement will be translated into two procedures by the compiler: 1. Callback ...

Posted by suspect on Mon, 18 Apr 2022 00:29:42 +0300

Mysql connection model, GORM connection model

GORM model definition The ORM framework needs to define the model in advance to operate the database. The model can be understood as a data model as the medium of operating the database.For example: The data read from the database will be saved to the predefined model object, and then we can get the data we want from the model object.Insertin ...

Posted by bqallover on Sun, 17 Apr 2022 17:20:38 +0300

go - variables and data types

go variable introduce Concept: a variable is equivalent to a data storage space representation in memory.Steps: ① declare variables (define variables); ② Assignment; ③ Use func main() { // Defining variables and assignments var a int = 10 var b int = 12 // Use variables fmt.Println(a + b) } Use details Variable represents a storage a ...

Posted by Venkatesh on Sat, 16 Apr 2022 10:44:30 +0300

Functions and Methods of GO Language Practice

Write before Well, learn GO, so I have this articleBowen is one of the reading notes of GO Language Actual WarMainly related to knowledge GO functions versus other languagesGO User Defined Types (Structures)Go method In the evening, you sit under the eaves and watch the day go dark slowly. You feel lonely and sad and deprived of your lif ...

Posted by Ricklord on Thu, 14 Apr 2022 20:06:18 +0300

Introduction to VSCode extension and implementation of suffix code completion

Our project team uses protobuf as the transmission protocol, and its benefits are needless to say. However, because the default number type of go is int and go belongs to a strongly typed language, switching types has become a common occurrence. Generally speaking, the steps of switching types are no more than: Select the number section. ...

Posted by Spikey on Thu, 14 Apr 2022 17:45:39 +0300

Seven day implementation of web Framework -- dynamic routing

I've seen the seniors use this dynamic routing before, but they haven't paid much attention to it before. Recently, they are building a learning framework. For the first time, I felt the application of the algorithm in writing projects. Before, I thought that the algorithm was used to brush questions, which was rarely used in actual combat. It' ...

Posted by alen on Thu, 14 Apr 2022 15:43:42 +0300

Introduction to Go language -- array and slicing

Go language introduction series article directory Introduction to Go language - basic grammarIntroduction to Go language – process statementGetting started with Go – arrays and slicingMap (Goo Goo) 🕊)String (string)functionPointerstructural morphologymethodInterfaceerrorpackageIO operationConcurrentreflex 1, Array 1.1 what ...

Posted by mydownfall on Thu, 14 Apr 2022 05:09:33 +0300

Application scenario of policy mode

Application scenario of policy mode The main purpose of the policy pattern is to separate the behavior from the specific algorithm or implementation. All roads lead to Rome. Taking different routes or travel modes, although there will be different algorithms or implementations, the final behavior is to go to Rome. Its basic implementation ...

Posted by cahamilton on Wed, 13 Apr 2022 03:54:04 +0300