Category: IT Community
-
Post Views: 48 Recently I plan to join the V2EX community, but the current registration mechanism is really not very friendly to newcomers. After some research, I have compiled a complete process from purchasing tokens to smooth registration. If you are also planning to hold the token to be exempted from the invitation code to register, or you have encountered…
-
Post Views: 49 In the official tutorial of Go language, Web Crawler practice is a very classic concurrent programming case. It requires us to modify a basic recursive crawler so that it can crawl the URL in parallel, while ensuring that the same URL is not repeated. This article will take you to analyze the original code problem step by…
-
Post Views: 102 Preface In most programming languages, it is quite complex to check if two binary trees store the same sequence of values. It is usually necessary to write a recursive algorithm to traverse the two trees and then compare them by node. But in the Go language, we can use its powerful concurrent primitives and channel (channel) mechanisms…
-
Post Views: 29 In Go language, errors are not an exception, but a value. By implementing the Error interface, we can create custom error types with rich context information. This article will combine Go Tour’s ‘exercise: errors’ exercise to explore how to implement a square root function that supports negative number detection, and reveal the ‘infinite recursion’ pit that is…
-
Post Views: 63 Following the previous articleMaps word counting exercisesAfter this, another classic exercise in the introduction of Go language – using closure to implement the Fibonacci sequence generator. This question can not only consolidate the core usage of closed packages, but also deeply understand the characteristics of ‘function as the return value’ in the Go language. This article will…
-
Post Views: 115 As a basic exercise for the entry of Go language, the use of MAPS (mapping) is one of the key knowledge points, and word counting exercise is a classic case of consolidating MAPS usage. This article will record in detail the implementation process, core ideas, code analysis, and key knowledge points involved in the exercise. 1. Description…
-
Post Views: 89 Recently, when I was doing the slices practice of the official go to the go, I encountered a series of dependencies download and running errors, and after tossing, I finally succeeded in running through. I have sorted out the complete stepping process and solutions, hoping to help those who practice Go Tour locally like me, and avoid…
-
Post Views: 44 1. When learning the official Go tutorial a Tour of Go, I encountered a very classic exercise:Implement a square root function sqrt(x). as shown in Figure 1 This exercise involves not only Go’s loops and functions, but also introduces a very important numerical calculation method:Newton iteration method (Newtons method). This article will demonstrate how to get from…
-
Post Views: 33 1. In VS Code Ctrl + S, the file is restored to the previous step, not the expected save file Before modification: After modification: After Ctrl + S : 2. Do a key check first, open the Visual Studio Code settings: press: Ctrl + , search: format on save to see if it is enabled: editor: format…
-
Post Views: 31 1. In VS Code, Go reports an error: Main redeclared in this block. The reason is that there are multiple main functions in the directory. as shown in Figure 1 2. Reorganize an exercise directory structure scheme of A Tour of Go to ensure that each exercise can run go run main.go independently, and there will be…