Tag:golang

  • Long connection, short connection, long polling, short polling and websocket

    Time:2020-7-13

    See a good article, specially reprinted, the original address: long connection, short connection, long polling, short polling, websocket 1、 Short connection and long connection Short connection: TCP connection will be established for each HTTP request, which is easy to manage Long connection: you only need to establish a TCP connection once. Later, HTTP requests reuse […]

  • Go JWT restful authentication tutorial

    Time:2020-7-13

    Original address https://mojotv.cn/go/golang–jwt–auth

  • Overview of wild seed data analysis

    Time:2020-7-11

    Revision of the official website of Yezi E-sports https://www.xxe.io/ Brand newData analysis1. What is data analysis?Baidu Encyclopedia defines:2. Data analysis and division3. The role of data analysis3.1 current situation analysis3.2 cause analysis3.3 forecast analysis4. Basic steps of data analysisClear analysis purpose and thinkingdata acquisitiondata processingData analysisData presentationReport writing Write in front of words: the previous […]

  • Set the value of goldlang when compiling

    Time:2020-7-10

    The Go linker (go tool link) has an option to set the value of an uninitialised string variable: -X importpath.name=value Set the value of the string variable in importpath named name to value. Note that before Go 1.5 this option took two separate arguments. Now it takes one argument split on the first = sign. […]

  • Using slice + index map instead of map to improve performance in golang

    Time:2020-7-9

    cause In our multiple online game projects, many modules and services store a large amount of (CACHE) data in memory to get the fastest access speed in order to improve the response speed. Usually, for convenience, go’s own map is used as the storage container. When there are more than several hundred thousand key values, […]

  • The principle of quick sort algorithm and its implementation in go language

    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 […]

  • How does go implement the encoding and decoding of protobuf (1): Principle

    Time:2020-7-7

    Link to the original text: https://mp.weixin.qq.com/s/O8… This is a sister article, which analyzes how go implements protobuf encoding and decoding How does go implement the encoding and decoding of protobuf (1): Principle How does go implement the encoding and decoding of protobuf (2): source code This is the first one. Introduction to protocol buffers Protocol […]

  • The method of using flag package to parse command line parameters in go language

    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 […]

  • How does go implement the encoding and decoding of protobuf (2): source code

    Time:2020-7-6

    Link to the original text: https://mp.weixin.qq.com/s/oY… This is a sister article, which analyzes how go implements protobuf encoding and decoding How does go implement the encoding and decoding of protobuf (1): Principle How does go implement the encoding and decoding of protobuf (2): source code This is the second part. preface How do go implement […]

  • Method of converting Unicode into string string by golang

    Time:2020-7-5

    This paper introduces the method of converting Unicode into string string by golang. For your reference, the details are as follows: Copy codeThe code is as follows: package main import (     “bytes”     “encoding/binary”     “encoding/hex”     “fmt”     “strings” ) func main() {     str := `\u5bb6\u65cf`     fmt.Println(u2s(str)) } func u2s(form string) […]

  • Go memory allocation, that’s it!

    Time:2020-7-4

    Link to the original text: https://mp.weixin.qq.com/s/3g… Old and new friends haven’t seen each other for a long time. I’m Dabin. I’ve prepared this article for a long time. Instead of procrastinating, I’ve done some other things and delayed some of them. This articleThis paper mainly introduces go memory allocation and go memory management, will slightly […]

  • Golang’s method of judging whether channel is closed

    Time:2020-7-4

    In this paper, an example is given to show how golang judges whether the channel is closed or not. For your reference, the details are as follows: A friend in the group asked how to judge whether a channel is closed, because the closed channel will not block and return the nil value of the […]