Go language Bible - Chapter 10 packages and tools - 10.1 - 10.7
Chapter 10 packages and tools
Now any small program may contain 10000 functions, but we can't build them one by one. Most of them come from others. These functions are reused in a way similar to packages and modules
There are more than 100 go language packages. You can use go list std wc -l to view them in the terminal. Open source packages c ...
Posted by ermarkar on Sun, 23 Jan 2022 06:47:22 +0100
Java vs Golang: basic syntax
Coding specification
Code layout
1. Curly bracket wrap style
In Java, each statement is marked with a semicolon " Separation, whether to wrap or not does not affect the correctness of the code.
In python, semicolon separation is eliminated, and the effect of parentheses on code logic is also eliminated (various parentheses in python ar ...
Posted by agent47 on Sun, 23 Jan 2022 04:27:10 +0100
[golang] leetcode Beginner - verify palindrome string & string conversion integer
Question 1 verify palindrome stringTopic informationGiven a string, verify whether it is a palindrome string. Only alphanumeric characters are considered, and the case of letters can be ignored.Note: in this topic, we define an empty string as a valid palindrome string. Example 1:Input: "A man, a plan, a canal: Panama"Output: trueExpl ...
Posted by Z3RatuL on Sat, 22 Jan 2022 13:03:20 +0100
Implementation of k-v storage engine from zero
The purpose of this article is to help more people understand rosedb. I will implement a simple k-v storage engine including PUT, GET and DELETE operations from scratch. You can regard it as a simple version of rosedb, just call it minidb (mini version of rosedb).
Whether you are a beginner of Go language, want to advance Go language, or are in ...
Posted by manichean on Fri, 21 Jan 2022 23:16:13 +0100
Golang toolset - String tool, time tool, http tool, etc
gotool
gotool is a small and complete tool set of Golang, which mainly refines and integrates the methods commonly used in daily development, avoids repeated wheel making and improves work efficiency. Each method is extracted from the author's work experience and previous projects.
How to use gotool?
install
go get github.com/druidcaesa/got ...
Posted by nmal on Fri, 21 Jan 2022 12:35:48 +0100
Deep analysis of KubeSphere backend source code
In this article, we will try to debug and learn the KubeSphere back-end module architecture based on the ssh remote plug-in on vscode.
premise
Install vscode and ssh remote container plug-ins;
Install kubenertes container "operating system" and kubesphere > = V3.0 on the remote host 1.0 cloud "control panel";
Ins ...
Posted by amchargue on Fri, 21 Jan 2022 03:46:58 +0100
Use of go test (specify a test, benchmark, testdata, cover, benchmark...)
brief introduction
This article will not say much about the role and necessity of testing. It is very convenient to test in go language. The official provides a relatively perfect test method, using go test command and testing standard library.
Basic usage
The directory structure is shown in the figure below The source file and the test file ...
Posted by jocknerd on Fri, 21 Jan 2022 03:09:33 +0100
Go language object oriented programming
1, Object oriented and process oriented
Process oriented programming code is only applicable to the current situation, while object-oriented programming pays more attention to reuse. The same set of code can be used in various situationsProcess oriented programming (OPP) is to implement the whole process in order in detail
For example, ...
Posted by raja9911 on Fri, 21 Jan 2022 01:11:10 +0100
Hyperledger learning: Super ledger chain code deployment and call (Part I: official example test)
Environmental inventory
Basic environment
Operating system: Ubuntu 21.04 amd64Golang : Version 1.16.5Docker : Version 20.10.7Docker Compose : Version 1.29.2Hyperledger Fabric : Github - hyperledger/fabric @v2.4.0
For basic environment installation, refer to the previous article: Hyperledger learning (I): basic environment installation a ...
Posted by karlovac on Thu, 20 Jan 2022 22:42:16 +0100
GoFrame framework: log configuration management
introduce
Through 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
wait
We will use rk-boot To start gogf/gf Microservices of the framework.
Please visit the following address for a complete tut ...
Posted by jazz_snob on Thu, 20 Jan 2022 22:35:11 +0100