• Brief introduction to the use of golang’s HTTP cookie


    During the development of server-side programs, cookies are often used to verify that a user is logged in. Golang’s net/ HTTP package comes with the definition of HTTP cookie, the following is a general use of cookies and need to pay attention to the problem. Definition of HTTP cookie Golang’s definition of cookie structure: type […]

  • [follow us to learn Golang] Go language full platform installation


    The first step in learning Go is, of course, to install the Go environment. After all, we can’t do anything without it.But before installing the environment let’s look at the environment variables that Go involves.Here are some of the more commonly used Go locale variables. GOROOT The default installation path of Go is ‘c:/ Go […]

  • Generate crud production code of each table of MySQL, golang


    When writing golang to connect mysql, you can’t escape the curd (add, delete, modify and query) operation.If ORM operation is used in production, performance will be affected. Only SQL operation generated from source is the best.If there are many tables, there are many duplicate codes. If there is a tool to produce curd code, it […]

  • [go] go get auto agent


    Original link: https://blog.thinkeridea.com/201903/go/go_get_proxy.html Recently, it was found that many people in the technology exchange group were asking about the failure of go get wall outsourcing, and they gave many solutions: From GitHub’s code base clone Set the goproxy environment variable to configure the proxy, for example: goproxy = https://goproxy.io Configure command-line proxy, httpsproxy environment variable […]

  • Source code analysis of golang channel


    Before I knew that the go team only used more than 700 lines of code to implement the channel, a big killer of inter process communication, so I went to the film to read it, but after the replay, I always felt that it was a little bit winding until I was lucky to find […]

  • GoLand 6 tips make go programming more efficient


    As a heavy user of JetBrains ide family barrel.Here are a few tips that can speed up your development and reduce the amount of taps you need to paste / copy your keyboard. 1. Realize interface quickly Operation steps: Move cursor to struct name Alt/Option + Enter Select implementation interface… Control + I Search the […]

  • Go scheduler series (4) source reading and exploration


    Dear friends, this time I want to share with you the knowledge and experience related to go scheduler source code reading. There are many good articles on the network that analyze the source code, so this articleIt’s not another source code analysis article. What we pay attention to is not source code analysis and sharing, […]

  • Detailed explanation of general connection pool based on channel implemented by golang


    Preface In addition to goroutine communication, there are many other functions in the channel of golang. This paper will implement a general connection pool based on channel. Let’s have a look at the detailed introduction. function *The connection type in the connection pool is interface {}, which makes it more general. *The maximum idle time […]

  • Program ape’s way to build Immortals


    <imghttps://timgsa.baidu.com/timg?image&amp” rel=”nofollow noreferrer”>https://timgsa.baidu.com/timg…;quality=80&size=b9999_10000&sec=1541245646279&di=70b2cfd6752b26aa4e9cb04579c8dd6a&imgtype=0&src=http%3A%2F%2Fwww.psahz.com%2Fuploads%2Fallimg%2F181006%2F094Q62X3-2.jpg” width=”100%” hegiht=”20%” align=center /> ==Main measurement standards of algorithm== Time complexity (running time) In the time complexity dimension of the algorithm, we mainly compare the times of comparison and exchange. For other algorithms that do not exchange elements, we mainly compare the times of accessing the array. In fact, many students are […]

  • Golang universal connection pool, grpc, RPC, TCP supported


    pool https://github.com/flyaways/pool Pool is used to manage connections between clients and service clusters. Main functions of pool: Universal connection pool – Pool for GRPC,RPC,TCP.support RPC timeout. Support cluster – Connet to Cluster. Dynamic update – Danamic update targets. Pool runs on Linux, Mac OS X, and Windows. statementAt present, random number strategy is used to […]

  • Leetcode 55. Jumping game


    Given an array of non negative integers, you are initially in the first position of the array.Each element in the array represents the maximum length you can jump at that location.Judge whether you can reach the last position. Example 1: Input: [2,3,1,1,4] Output: true Explanation: skip 1 step from position 0 to 1, then 3 […]

  • Solving Joseph’s ring problem with unidirectional circular list


    Problem description No. 1, 2,… , n of n people sit in a clockwise circle, each holding a password (positive integer). At the beginning, select a positive integer as the upper limit value m of the number reported. The number is reported from the first person in a clockwise direction starting from 1, and stops […]