• Slice expansion method


    Q: Please introduce yourself briefly firstA: Mani mani mani mani mani mani mani mani mani mani mani Mani, Mani mani mani mani ManiQ: You talk so much. Do you know arrays?A: Array is a data structure with the same type and fixed length. Because the length cannot be changed, it is rarely used in practice. […]

  • Microservice – current limiting: I Implementation of token bucket algorithm by golang


    At first, it was because we had to pull some third-party data, and the API interfaces of the third-party were limited flow measures. For example, 6000 / min, 500 / min. If you want to pull data, you can use multiple collaborative processes. But it is easy to overclock, so I want to write a […]

  • Actual combat Tianyi cloud host system disk expansion


    The default system disk capacity provided by Tianyi cloud host is 40g, which can be adapted to most scenarios. However, in some special scenarios, the default 40g system disk space is insufficient, and the system disk must be expanded. What should we do at this time? Let’s fight today.Take CentOS 6 (which is also applicable […]

  • Detailed explanation of the underlying array of slices


    package main import “fmt” func main() { s := []int{0,1,2,3,4,5,6,7,8,9} s1 := s[1:5] fmt. Printf (“s [1] = = >% P, s length = = >% D, s capacity = = >% d \ n”, & s [1], len (s), cap (s)) fmt.Printf(“s[2] ==> %p \n”,&s[2]) fmt.Printf(“s[3] ==> %p \n”,&s[3]) fmt.Printf(“s[4] ==> %p \n”,&s[4]) fmt.Printf(“s[5] […]

  • what? Infinite buffered queue (2)?


    chanx In the previous article, we mentioned that when we create a buffered channel and specify the capacity, we will no longer be able to change its capacity during the life cycle of the channel. This raises questions about infinite cachingchannelTopic discussion.We analyze a code that implements infinite buffering. Finally, we also mentioned the points […]

  • Best practice – detailed explanation of five schemes for building cloud private pool (virtual IDC)


    Author: Li Yuqian, Alibaba cloud technology expert abstract Focusing on the value, acquisition, purchase, capacity planning and landing construction of private pool (virtual IDC), we will introduce them one by one in the form of special articles. For example, it introduces the value of private pool and how to obtain it from the perspective of […]

  • Record a MySQL large table cleanup operation


    The production database has many large tables, and the amount of data is very large, which has had an impact on the stability of the system. After communication, the data of each day was stored in these tables, but only the data of the last day of each month was stored. Here are some common […]

  • Study hard go: 8 Built in collection – Slicing


    Series articles: Study hard go: 1 Learning lead Study hard go: 2 Environment construction Study hard go: 3 Environment construction – gomod learning Study hard go: 4 Variables and data types Study hard go: 5 Constants and operators Study hard go: 6 Process control Study hard go: 7 Built in collection array Study hard go: […]

  • Go quiz: see the underlying principles and precautions of slice from the go interview questions


    Interview questions Recently, 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 see the following aboutsliceThrough this question, we cansliceHave an in-depth understanding of the characteristics and precautions of. package main import “fmt” […]

  • Some data structures that slice needs to understand during use


    Src / Runtime / slice Go: slice defines the data structure of slice. From the data structure, slice is very clear. The array pointer points to the underlying array, len represents the slice length, and cap represents the capacity of the underlying array: type slice struct { array unsafe.Pointer len int cap int } In […]

  • Analysis of ArrayList source code


    Introduction:ArrayListAs the most commonly used collection in our development and the class used very frequently, we might as well read the source code and talk about it. preface ArrayList is the most commonly used collection in our development. As a class used very frequently, we might as well read the source code and talk about […]

  • Go basic grammar


    1. Data type Go language supportedFoundation type: Integer: int, int8, int16, int32, Int64 Unsigned integer: uint, uint8, uint16, uint32, Uint64 The default type is int, which means 32-bit or 64 bit, which is related to the operating system Byte: byte Boolean: bool Floating point type: float32, float64. The default type is float64 Complex number: complex64 […]