go bottom series - slice bottom implementation

slice preface Also known as dynamic array, it is realized by arrayConvenient capacity expansion, transmission, etc Because of its flexibility, if you do not understand its internal implementation mechanism, you may encounter inexplicable exceptions. Warm Up // Topic 1 package main import "fmt" func main() { var array [10]int var s ...

Posted by BTalon on Thu, 09 Dec 2021 22:36:15 +0100

Go learning beginner level chapter

1. Object oriented representation and encapsulation in go language Like Go language, it has the idea of facing objects. We can directly feel the definition and encapsulation of a class in Go language through an example. package main import "fmt" type Human struct { Name string Gender string } // Bind some methods to attributes func (this ...

Posted by UmneyDurak on Thu, 09 Dec 2021 14:02:43 +0100

Go language core 36 lecture (go language practice and application 23) -- learning notes

45 | using API in os package (Part 2)In our last article. This paper introduces a series of related contents from the issue of "which io package interfaces are implemented by os.File types". Today we continue to expand around this knowledge point.Knowledge expansionQuestion 1: what are the operation modes that can be applied to the Fi ...

Posted by subcool on Thu, 09 Dec 2021 04:04:15 +0100

gRPC security Part-2: fast implementation of server-side JWT authentication

introduceThis article describes how to rk-boot Implement the server JWT verification logic.What is JWT?JSON network token is an Internet standard used to create data with optional signature or optional encryption so that claims can be safely represented between two parties. The token is signed with a private secret or public / private key.In sh ...

Posted by blackandwhite on Wed, 08 Dec 2021 22:47:55 +0100

[Go process control structure]

Process control statements are used to control the execution order of the program, so that the program has a logical structure. General process control statements need to be used in combination with various conditions, such as conditional judgment if, switch for selection, and for loop. if conditional statement If statement is a conditional s ...

Posted by joad on Wed, 08 Dec 2021 06:30:57 +0100

Go learning notes (82) - viper of go third-party library (parsing configuration file, hot update configuration file)

1. viper features viper is a complete configuration solution for Go applications. It is designed to work in applications and can handle all types of configuration requirements and formats. The supported features and functions are as follows: Set defaultsRead configuration files for JSON, TOML, YAML, HCL, envfile, and Java propertiesMonitor co ...

Posted by roy on Wed, 08 Dec 2021 01:45:39 +0100

GRPC: quick create static file download Web service

introduceThis article describes how to rk-boot Quickly build a static file download Web service.What is the static file download Web UI? Quickly build Web services that can download files through configuration files.Please visit the following address for a complete tutorial:https://rkdocs.netlify.app/cninstallgo get github.com/rookie-ninja/rk-b ...

Posted by chen2424 on Mon, 06 Dec 2021 23:56:02 +0100

Concurrent map of go concurrent Security Map

Source code interpretationThe readme of concurrent map says that this is a high-performance concurrent security map. Let's look at the source code to explain how it achieves high performance.https://github.com/orcaman/concurrent-map/blob/master/concurrent_map.goThe source code is quite concise, only 343 lines. Let's first look at how to design ...

Posted by Sturm on Sun, 05 Dec 2021 21:57:17 +0100

Explain the principle and implementation of Bloom filter in detail

Why do I need a bloom filter Imagine how you would handle the following scenario: Whether the mobile phone number is registered repeatedlyHas the user participated in a second kill activityForge requests for a large number of id query records that do not exist. At this time, the cache misses. How to avoid cache penetration To solve the above ...

Posted by mrbaseball34 on Sun, 05 Dec 2021 13:13:35 +0100

My first experience of Go + language -- Go language summary (grammar + practical problem solutions)

Introduction to Go language: As the father of C language, Go language is widely used in various fields in the future. Its grammatical features are similar to C language and more flexible. Goland Goland is a commercial version of the Jetbrains family ide Download address: Goland LiteIDE Open source go language IDE Source address: Github D ...

Posted by sumolotokai on Sun, 05 Dec 2021 07:58:37 +0100