Thoroughly understand Golang Map

The contents of this article are as follows. After reading this article, you will find out the following interview questions related to Golang MapInterview questionsThe underlying implementation principle of mapWhy is traversing a map unordered?How to realize orderly traversal of map?Why is Go map non thread safe?How to implement thread safe ma ...

Added by adam_gardner on Tue, 25 Jan 2022 19:20:09 +0200

Go learning data types and basic usage details

data type I would like to call golang a very strong type language. Although the type declaration can be omitted, the type requirements between variables are very strict. See the data type conversion for details. Basic types: Boolean, numeric, string, array Other types: rune Advanced types: Map (set), pointer, structure (there is no class in ...

Added by daverico on Tue, 25 Jan 2022 18:16:00 +0200

Using git kit to realize microservices supporting http and grpc

Using git kit micro service framework to realize an application that supports http and grpc services at the same time. Take one of the most common article services as an example to start the tutorial! Project shelf Introduction to go kit three-tier model Go kit is an open source collection of golang microservice tools. Go kit provides a thre ...

Added by bryansu on Tue, 25 Jan 2022 15:42:42 +0200

TiDB compilation and sharing on CentOS

Here are some points in the compilation process of TiDB. Although in theory, the source code downloaded from github can be compiled after decompression, in the actual operation process, there may still be errors due to various reasons. This paper shares several problems and solutions in the actual operation process. The environment used in t ...

Added by Donnamabob on Tue, 25 Jan 2022 14:22:14 +0200

GoFrame framework: log configuration management

introduceThrough a complete example, in gogf/gf Manage logs reasonably in the framework.What are the usage scenarios?Log auto scroll Split into multiple log files Log format modification waitWe will use rk-boot To start gogf/gf Microservices of the framework.Please visit the following address for a complete tutorial:https://rkdocs.netlify.ap ...

Added by Mountain Water on Tue, 25 Jan 2022 13:35:43 +0200

How does go language limit the number of concurrent processes

preface When using concurrency to process some tasks, the number of concurrency can not be increased indefinitely due to the limitation of various factors For example, network requests, database queries, and so on. From the perspective of operation efficiency, the concurrency should be as high as possible on the premise that the related service ...

Added by gooney0 on Tue, 25 Jan 2022 11:57:03 +0200

[golang] leetcode Beginner - delete the penultimate node of the linked list & reverse the linked list

The first question is to delete the penultimate node of the linked listTopic informationGive you a linked list, delete the penultimate node of the linked list, and return the head node of the linked list.Problem solving ideas1. To delete the nth node, we only need to set a pointer, locate it to the previous node of N, and then change its next p ...

Added by KI114 on Tue, 25 Jan 2022 11:30:38 +0200

GO: basic data type - slice

1, Limitations of arrays   Because the length of the array is fixed and the length of the array is part of the type, the array has many limitations. For example: func arraySum(x [3]int) int{ sum := 0 for _, v := range x{ sum = sum + v } return sum } This summation function can only accept [3]int type, and others are ...

Added by pablodelapena on Tue, 25 Jan 2022 09:26:25 +0200

[golang] leetcode Beginner - Implementation of strStr() & appearance sequence

Question 1: implement strStr()Topic informationImplement the strStr() function.Here are two strings: haystack and need. Please find the first position of the need string in the haystack string (the subscript starts from 0). If it does not exist, - 1 is returned. explain:When , need , is an empty string, what value should we return? This is a ...

Added by wildcolour on Tue, 25 Jan 2022 02:54:10 +0200

golang learning notes 003 -- variables and data types

1. Variables 1.1 three ways to use variables ● the first: specify the variable type. If no assignment is made after declaration, the default value is used ● the second: self judgment according to the value (type derivation) ● the third: omit var. Note: = the variables on the left should be undeclared, otherwise the compilation error will ...

Added by CPInteract on Mon, 24 Jan 2022 08:53:38 +0200