Data structure and algorithm foundation - Go language version - 2. Stack

catalogue preface 1, Definition and characteristics of stack? 2, Implementation of stack 2.1 sequence stack 2.1.1 structure definition of sequence stack 2.1.2 initialization of sequence stack 2.1.3 judge whether the stack is empty or full 2.1.4 stacking 2.1.5 out of stack 2.1.6 preview stack top elements 2.2 chain stack 2.2.1 struct ...

Posted by allanric on Thu, 18 Nov 2021 08:10:35 -0800

Getting to know gin framework

Introduction and use of Gin framework Gin is a web framework written in Go language. It is an API framework similar to martini but with better performance. Due to the use of httprouter, the speed is increased by nearly 40 times. If you are a performance and efficiency seeker, you will fall in love with Gin. Go is the most popular web framew ...

Posted by StroiX on Wed, 17 Nov 2021 04:51:48 -0800

Google: 12 Golang best practices

Included in On Technology , author "Lao Miao" These are the 12 items that have been directly summarized. Continue to look at them in detail: Handle errors first to avoid nesting Try to avoid repetition Write the most important code first Write documentation comments to the code Naming should be as concise as possib ...

Posted by mikewooten on Tue, 16 Nov 2021 22:40:54 -0800

Write a Java virtual machine in Java

Project link Welcome, star preface Refer to "write your own Java virtual machine" to write a JVM. This book uses Go to write a JVM without JIT, PGO, or even GC. It can be said that it is very useless. Then I rewrite the JVM in Java. The Java virtual machine written in Java can be said to be more useless. Regardless of Ecology (be ...

Posted by 303tech on Tue, 16 Nov 2021 08:38:24 -0800

Golang uses object-oriented thinking to program 2

Remember the best code I've ever written for this vegetable chicken. The purpose is to write a configuration file saving module to save some configurations that need to be saved in the project. Because the data to be saved is scattered in many modules. I have thought about building a large structure, and then put all the data to be saved into ...

Posted by teebo on Tue, 16 Nov 2021 08:08:20 -0800

[docker series] docker learning IV. principles related to image

[docker series] docker learning IV. principles related to imageWhat is mirroring?Mirroring is a lightweight, executable, stand-alone software package.Image is used to package the running environment of software and software developed based on the running environment. It contains all the contents required to run some software, such as code, runt ...

Posted by Reef on Fri, 12 Nov 2021 10:30:39 -0800

Go operating Mysql database is so smooth

Go operation Mysql database There is a database/sql package in go, which defines the methods of connecting and operating the database, And the native supports connection pool, which is concurrent and safe. This standard library has no specific implementation, but lists the specific contents that need to be implemented by a third-party libra ...

Posted by malec on Wed, 10 Nov 2021 21:56:03 -0800

Sentinel go source code series initialization process and responsibility chain design pattern

In the last section, we learned about what sentinel go can do, and the simplest example is how to run In fact, I have written the second part of this series for a long time, but it has not been released yet. I feel that the light initialization process is somewhat single, so I added the responsibility chain mode, two in one, and the content is ...

Posted by PatriotXCountry on Tue, 09 Nov 2021 02:23:12 -0800

Some small details in Golang

1. The structures in golang can be compared directly. The bottom layer calls the memequal function to compare the memory. Memequal is implemented by assembly.   2. Only values are passed in golang. For example, when a slice is used as a formal parameter of a function, it is also a value transfer. The underlying data structure of the slice is: ...

Posted by vivekjain on Mon, 08 Nov 2021 23:47:01 -0800

Golang NSQ message queue usage practice

I read a lot on the Internet and copied the official website README. I didn't explain many important things clearly. I had to study it myself.My blog, keyword Less-Bug.com, welcome to pay attention.Introduction to NSQnsqd: daemon, client communication. Default port 4150 (TCP) 4151 (HTTP)Nsqlookupd: equivalent to a router. The client can discove ...

Posted by mabans on Mon, 08 Nov 2021 23:18:21 -0800