Go Founders Interpretation: How to program bugs?

Hello everyone, I am fried fish. Some time ago I shared an article " 10+ Official Go Proverbs, How Many Do You Know? , which sparked discussions among many friends. One of them is "Errors are values". Everyone jumps around repeatedly between "Errors are values" or "Errors are values", which is not easy to tangle. In fact, Rob Pike, who said this sentence, used an article " Errors are values ​​[1] " to interpret the meaning of this proverb....

July 31, 2022

Go Language Lover's Weekly: Issue 153

Here is a record of Go language-related content worth sharing every week, released on Sunday. This week's magazine is open source (GitHub: polaris1119/golangweekly [1] ), welcome to contribute, recommend or self-recommend articles/software/resources, etc. Please submit issue [2] . In view of the fact that some people may not be able to insist on reading the English articles, the weekly will recommend high-quality Chinese articles as much as possible. Excellent English articles, translated by our GCTT organization....

July 31, 2022

Go language time processing operations

As programmers, we often have to deal with time. In Go, the standard library time provides a corresponding capability. This article will introduce some important functions and methods in the time library, hoping to help those children who need Baidu when they encounter Go time processing problems. Coping with time zone issues In programming, we often encounter the eight- hour time difference . This is caused by time zone differences, and in order to better address them, we need to understand several time definition criteria....

July 31, 2022

If you don't want Go error handling to be too bloated, you can refer to this code design

Recently, I wrote a program, because it is urgent (it seems that there is no need to be in a hurry...), so this program is copied by me in the east and glued in the west. After the code was written, I felt like the code was shit, and I almost cried myself. I really wrote it in my heart, don’t scold me, first I scold the people who worked on this project before for being stupid, the project was like shit, and then the code ran, and after the smooth delivery, I became scold me for being stupid, so it’s not impossible to write like this use!...

July 31, 2022

In Linux production environment, the most commonly used set of "vim" skills

focus on "The Script House ” , with millions of developers Original: Miss Sister Taste (WeChat Public Account ID: xjjdog) Reprinted with the authorization of the original official account Introduction The editor that is most used in R&D online is vi. Whether it's the quickest way to view the contents of a file, or to quickly edit a file, viit can help. The software world seems to have some very long-lived things, vibe it one....

July 31, 2022

Informatics Olympiad Real Questions: Heap Sort (Python & C++)

Heapsort (Heapsort) refers to a sorting algorithm designed using the data structure of the heap. Stacking is a structure that approximates a complete binary tree, and at the same time satisfies the property of stacking: that is, the key value or index of a child node is always less than (or greater than) its parent node. Heap sort can be said to be a selection sort that uses the concept of heap to sort....

July 31, 2022

Input of functions in Excel

Functions and formulas are undoubtedly one of the most fascinating features in Excel. Using functions and formulas can help users to complete various required data operations, summarization, extraction and other tasks. Functions and formulas combined with data validation can limit the input content or type of data, and can also create dynamically updated drop-down menus. Functions and formulas are combined with the conditional formatting function to display user-defined formats according to the contents of cells....

July 31, 2022

linux install docker

Installation Environment Linux version: CentOS Linux release 7.9.2009 (Core) System version: Linux 3.10.0-1160.el7.x86_64 system update Execute the system update command to update the system yum update install yum-utils device-mapper-persistent-data lvm2 yum install -y yum-utils device-mapper-persistent-data lvm2 Configure local mirror yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo Install docker community edition yum list docker-ce --showduplicates | sort -ryum install 3:20.10.9-3.el7 yum install docker-ce18.03.1.ce View docker version docker version start docker systemctl start docker set auto start...

July 31, 2022

Nodejs browser side debugging

create a server const http=require("http") const server=http.createServer((request,response)=>{ const url=request.url console.log(url) response.write('hello world') response.end() }) server.listen(8080,()=>{ console.log('localhost:8080') }) Browser debugging of node: node --inspect --inspect-brk server.js Node process management tool: supervisor nodemon forever pm2 Install nodemon globally: npm i nodemon -g Start a service with nodemon nodemon server.js When the content of server.js changes, there is no need to restart the service, just refresh the page The browser side displays:...

July 31, 2022

NodeJS study notes - Hello World! Hello NPM!

Directory/Contents: Learn about Node.js This sentence is put on the homepage of Node.js Chinese website and English official website Node.js is a JavaScript runtime based on the Chrome V8 engine Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine . Runtime, the runtime environment of a programming language NodeJS extends JS, so that JS can be separated from the browser and run directly on the physical machine, which means that NodeJS can directly manage and control machine resources....

July 31, 2022