Chinese takes three bytes in the Go language, Len or range a Chinese string is different from what we expected.UTF8 for length. Runecountinstring, traversing with RuneFunc Main () { txt:"ABC good learning " fmt. Println ("len Length:", Len
Goland is a tool developed by INTELLIJ company to develop Golang. Because I am a heavy IntelliJ company's product users, almost used its production, Goland once launched, I developed golang the preferred IDE.If you have previously used IntelliJ idea
The technology stack used by Hangzhou head office
Golang Gateway (front background routing, anti-crawler, authentication) Go language is better for high concurrency support
Python-related projects for data processing,
Java Web, micro-service
Algorithm title: Number of islandsDifficulty: IntermediateImplementation language: GolangIslands. png
Idea: Starting from the vertex (0,0), respectively to the left and right to traverse, meet 1 set to 0, meet 0 stop, traverse to 4 directions are 1
The Go program's entry function is the main function below the main package. When he needs to call another package, he will go to the goroot below to find the corresponding package. If you want the program to find our own development of the package
Recently in the development process encountered several goroutine communication problems, I think these questions are very representative, so take out and share with you.
Check if channel is closed
In the development process encountered such a
Address: Https://github.com/adwpc/pagent
Pagent is a Golang library of multi-process models with the following features:
Simple: Parent-child processes interact only with stdin and stdout
Security: Multi-process is secure, child process hangs one
TensorFlow Profiler UI
Install Python Dependencies.pip install --user -r requirements.txt
Install pprof.
Note: Installation requires the first installation of go and Google home pprof tools.
Create a profile context.
Start the
1. Go Environment installation
SOURCE Installation
wget https://dl.google.com/go/go1.10.3.linux-amd64.tar.gztar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz
Set environment variables,
vim /etc/profile
Then add the environment variables, Gopath is
Map must be familiar to everyone, below a simple record of today's development encountered pit.
Basic Concepts > dictionaries (MAP)
A dictionary is a set of unordered, key-value pairs. A dictionary is also called an associative array, because the
Package
Go language has been wrapped as a management unit
Each file must be declared first: package
Each file must consist of a main package
Import for importing libraries
The referenced library must be used
Entry
I in the daily Golang project development, the use of some third-party open source libraries, most of them are excellent open source projects, the source code worthy of serious reading research. Some of the libraries used in this record:
1. Parsing
Sort. Slice is a method of slicing sorting provided by Golang,
Where the reflection (reflect) package is used
241 // Slice sorts the provided slice given the provided less function.242 //243 // The sort is not guaranteed to be stable. For
Linux (CentOS redhat) installation1. Access to the official address:https://golang.org/dl/Because of the relevant ZC you know, it's better to go through the wall.2. Download the 64-bit Green
In the development. Sometimes we may be using git to introduce another Git repository under the project directory from the Web.
Such as. When I use the Vendor directory to store my Golang dependent libraries. Because the library in this directory is
Drop, drip ... Why is such a beginning, brush vibrato understand, there is a period of time driving in the road, a bunch of shaking friends by the horn let you pick up the signal, embarrassed a embarrassed, that this and today talk about the topic
instruction
Description
Notes
Go version
View version
Go run
Run the script
Go Install
Install self-packages or dependent packages
Go Build
Compiling and
Sync. Once can implement a singleton mode to ensure sync. Once.do (f func ()) is executed only once and can initialize an instance singleton.
Sync for Golang 1.9. Once, the same as the Golang 1.10. Source code location: Sync\once.go.
Structural
The most recent use of consul service registration as a project and the underlying functionality of service discovery. In the tower building cluster use encountered some pits, the following a record down.
Consul cluster Multiple node
The consul
Go Language Environment Installation
Go install package download URL:
Golang China: https://www.golangtc.com/download
Go Language Chinese Web: https://studygolang.com/dl
There are two versions of Zip and MSI installed as per this download. (It
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service