Golang Learning Notes
[TOC]
Golang Learning Notes
This learning note was written as early as the beginning of 1.0, around the version, and may differ greatly from the latest version.
Because it was written earlier, and there were many own opinions in the article, some things that were not well understood at that time might have been written incorrectly. Some places ...
Added by Angry Coder on Tue, 23 Jul 2019 19:56:51 +0300
Golang Understanding - Anonymous Functions
Anonymous function
Anonymous Function in computer programming refers to a class of functions that need not be defined. identifier (function name) function or subroutine It exists in many programming languages. wikipedia
Golang supports anonymous functions, that is, when a function is needed, it is redefined. Anonymous functions have no functio ...
Added by leena on Sun, 21 Jul 2019 16:49:12 +0300
Initial contact with gRPC golang
Summary
gRPC uses protocol buffers as IDL (Interface Definition Language), which provides a cross-platform, cross-language RPC (Remote Procedure Call) mechanism, this paper introduces the basic use of gRPC through an example program.
Preconditions
Go Version 1.6 and above ( Delivery)
$ go version
Install gRPC
$ go get -u google.golang.org/g ...
Added by deception54 on Wed, 17 Jul 2019 19:16:12 +0300
Go Source: Coprocess Stack
Original: Go Source: Coprocess Stack
Tips
Go version 1.12
Inspired by Contiguous stacks
When it comes to implementation details, you need to Stack Frame And pointer operation basis.
Preface
Stack management use of go prior to version 1.4 Segmented stack Mechanism implementation.Implementation: When a function is detected to require more stac ...
Added by myfafa on Mon, 24 Jun 2019 19:35:24 +0300
Go Learning Notes (2) Start in Ten Minutes
Add Golang Learning QQ Group to Learn Progress, Start a Family and Start a Business Job ^-^ Group Number: 96933959
Variable-Constant
variable
Variable names consist of letters, numbers and underscores, and cannot begin with numbers.
...
var (
A int //Default is 0
B string //Default is""
C bool //Default is false
...
Added by biscutty on Fri, 14 Jun 2019 01:09:30 +0300
Mapping of 11 Go Language-map
Mapping of Go Language-map
[TOC]
Like hash tables or dictionaries in other languages, data is stored in key-value form
Key must be a type that supports == or!= comparison operations, not a function, map, or slice; value can be of any type.
Map lookup is much faster than linear search, but 100 times slower than the type of data accessed using a ...
Added by windwaker on Sun, 19 May 2019 10:11:47 +0300
Go36-3-Code Pack
Splitting code into multiple files
If the code is too complex, you can write it in multiple source files. Or in other code packages (later on)
Code example
Here is the body of the program, but it calls the square() function, which does not declare:
// Go36/article03/example01/demo.go
package main
import (
"flag"
"fmt"
)
var x int
...
Added by step on Wed, 15 May 2019 19:58:52 +0300
Go Implements Mass Log Collection System (3)
I've reorganized the box for this log collection system, as shown below
The overall logic of the code to be implemented this time is:
The full code address is: https://github.com/pythonsite/logagent
Introduction to etcd
Highly available distributed key-value storage for configuring sharing and service discovery
Similar projects: zookee ...
Added by laflair13 on Tue, 14 May 2019 23:30:40 +0300