From Delphi to Go - List

The most basic list in Delphi is TList class and TList < T > generic class, as well as thread safe TThreadList class and TThreadList < T > generic class. The underlying implementation is array. Go uses the container/list package, and the internal implementation is a two-way linked list. Delphi TList In TList, there is a pointer. Whe ...

Posted by fredi_bieging on Wed, 30 Oct 2019 11:27:29 -0700

[series] - go in API routing middleware signature verification

overview First, synchronize the following project overview: The last article shared that Jaeger link tracking, a routing middleware, had an unexpected response. The "Go China" public account was also forwarded. Many friends joined me to communicate with each other and called me "God". In fact, what God am I? It's just a loc ...

Posted by hustler on Sat, 26 Oct 2019 03:13:21 -0700

Identifier, identifier, variable, constant, iota in GO

Reference resources: https://www.cnblogs.com/nickchen121/p/11517455.html I. identifier and keyword 1. identifier In programming language, identifier is a special word defined by programmer, such as variable name, constant name, function name, etc. In Go language, identifiers are composed of alphanumeric characters and ﹣ (underscore), and can o ...

Posted by Devious Designs on Thu, 24 Oct 2019 04:44:19 -0700

Server code analysis of Go mass chat room project

The whole project uses MVC mode, CS architecture, transmission layer based on TCP protocol, application layer based on custom protocol, and developed with Go language. The project has strong expansibility. Server master function func main() { initPool("localhost:6379", 16, 0, 300*time.Second) ini ...

Posted by K3nnnn on Wed, 23 Oct 2019 09:28:51 -0700

Performance test of golang mainstream high performance web framework

Test purpose Because of K8s, I dabbled in go language and found that there are many web frameworks of golang, which are called high-performance benchmarks. I have been committed to the research of c + + high-performance server framework before. Out of curiosity, I want to objectively compare the many web frameworks of go from the performance le ...

Posted by thecookie on Mon, 21 Oct 2019 01:32:30 -0700

How to debug a Docker container from a separate container

Containers are great for encapsulating software, but sometimes you can go too far by blindly altering the container image to make it as small as possible. We need to find a good balance between "clean" images and images that cannot be debugged. The normal way to see people debugging a running container is to docker exec - it $containe ...

Posted by jolinar on Sat, 19 Oct 2019 04:23:48 -0700

go learning notes: Interpretation of defer delay function

There is a defer keyword in Go language, which is often used to implement delay function to ensure the final execution of key code. As the saying goes, "you can be prepared before it rains." Delay function is such a mechanism. No matter whether the program returns normally or reports an error abnormally, as long as there is a delay fu ...

Posted by blackthunder on Fri, 18 Oct 2019 03:06:33 -0700

There's something wrong with the reptile

After the code optimization of golang climbing treasure net, the following error was reported. It took half an hour to find out the reason. Record here. The code is as follows: There is a Parser of type interface: type Parser interface { Parser(contents []byte, url string) ParserResult Serialize() (funcName string, args interface{}) } ...

Posted by robin105 on Thu, 17 Oct 2019 15:14:25 -0700

Analysis of golang and command source code

Some time ago, a group of friends asked a go language question in the group: The main function of main.go calls the hello() function of demo.go. The main.go and hello.go belong to the main package. However, executing go run main.go in the directory of main.go will report that the Hello function is undefined: The code structure is as follows: * ...

Posted by gpong on Thu, 17 Oct 2019 13:59:00 -0700

Climb the treasure net with go language

In the first two sections, we got the city URL and city name. Today we will analyze the user information. Climb the treasure net with go language for the first time Climb the treasure net with go language Crawler algorithm: To extract the city list in the returned body, we need to use the city list parser; All users in each city need to be par ...

Posted by kbc1 on Thu, 17 Oct 2019 10:56:34 -0700