Tag:Go language
-
Time:2021-2-6
1、 Download go language installation package Download address of official website:https://golang.org/dl/, use the tar command to unzip the file package to the / usr / local directory: sudo tar -C /usr/local -xzf go1.11.5.linux-amd64.tar.gz 2、 Add environment variables and work variables to the system environment First enter the profile directory: cd /etc Open profile file: sudo […]
-
Time:2020-11-18
There is a problem with golang channel: it is found that the go coprocessor does not execute cooperatively as expected when reading channel data. After checking the data: Due to improper operation of channel, there are buffers and no buffers in channel. The following is the difference between them. No buffer channel Chan created with […]
-
Time:2020-11-7
Blackfriday is a markdown processor implemented in go. You can input user provided data safely, fast, support universal extensions (tables, smart punctuation replacement, etc.), and it is safe input for all UTF-8 (Unicode). Currently, HTML output and smartypants extension are supported. use First of all, of course, we should introduce: import github.com/russross/blackfriday then output := […]
-
Time:2020-8-22
Each language has its own coding standards. Learning the naming rules of the language can make the code you write easier to read and less prone to low-level errors. According to personal coding habits and some articles on the network, this paper sorts out some coding standards that you can use. It may be some […]
-
Time:2020-7-15
1. Preface Golang, as a programming language rising star from a well-known family, is like the redis platform CODIS of Douban, and the cloud notebook like Evernote. 1.1 why study If someone speaks x language better than y language, supporters of both sides often quarrel fiercely. If you’re an old hand at a language, you’re […]
-
Time:2020-7-14
install Windows is a direct installation package. Let’s skip here and take a look at the installation of go under Ubuntu sudo add-apt-repository ppa:gophers/go sudo apt-get update sudo apt-get install golang-stable or sudo apt-get install golang Or download the go language installation package directly Environment configuration: vi /etc/profile join export GOROOT=/usr/lib/go export GOARCH=386 export GOOS=linux […]
-
Time:2020-7-9
Quick sort is an important sorting algorithm based on divide and conquer technology. Unlike merge sort, which divides elements according to their positions in the array, quick sort divides elements by their values. Specifically, it rearranges the elements in a given array to get a quick sort partition. In a partition, all elements before s […]
-
Time:2020-7-8
Quick sort algorithm First of all, put the number on the left side of the recursive array, and then put it on the left side of the number, and then put it on the left side of the number. The key part of the algorithm is to realize the partition of array, that is, how […]
-
Time:2020-7-7
flag Flag is a package provided by go standard library to parse command line parameters. Usage: flag.Type(name, defValue, usage) Where type is string, int, bool, etc., and returns a pointer of the corresponding type. flag.TypeVar(&flagvar, name, defValue, usage) Bind flag to a variable. Custom flag As long as it is realized flag.Value Interface can be […]
-
Time:2020-7-6
This paper describes the use of if / else statement in go language. For your reference, the details are as follows: The if else branch is straightforward in go. Here’s a simple example. If statements can have no else. You can add another statement before the conditional statement. The scope of the variable declared in […]
-
Time:2020-6-12
This paper introduces the principle and usage of SQL package in go language. To share with you for your reference, as follows: The SQL package of go is in PKG / database. The two packages SQL and SQL / driver can be viewed together. It is recommended to look at the SQL folder before looking […]
-
Time:2020-6-9
In this paper, an example of the go language eclipse environment construction method. To share with you for your reference, as follows: 1 download eclipse 2 download goeclipse http://code.google.com/p/goclipse/wiki/InstallationInstructions 3 download gocode https://github.com/nsf/gocode Download the source code to the path of gopath Go build Can be generated on the parent directory gocode.exe 4 download MinGW […]