How to use Github hook for automatic deployment
Recently, I bought domain name and server by chance. It's not really a waste. In addition, I haven't owned my own personal website, so I plan to play on the server with hexo, so I don't have to worry about whether to use Github pages or Gitee pages. Of course, today's topic is not blog building, but how to use Github's hook to deploy blog code ...
Posted by CodeMama on Sun, 26 Apr 2020 04:50:10 +0200
Go language Gin Web Framework
Gin Web Framework
brief introduction
web framework developed based on httprouter: https://github.com/gin-gonic/gin
Provides Martini style API, but 40 times faster than Martini
Very lightweight, simple to use
Installation and use of Gin framework
Install: go get -u github.com/gin-gonic/gin
Basic use
import "github.com/gin-gonic/gin"
func ...
Posted by ericwright17 on Sun, 19 Apr 2020 16:23:46 +0200
Golang Performance Test Trace Planing Goang trace
brief introduction
Tracking profiling is not available for most services.But if you encounter the following problems, you might as well try:
Suspect which partnership is slow
System call problem
Collaborative scheduling problems (chan interaction, mutex, semaphore, etc.)
It is suspected that gc (Garbage-Collect) affects service performance
Net ...
Posted by eth0g on Fri, 17 Apr 2020 04:53:25 +0200
Getting started with Go Mysql and Redis
Mysql and Redis operations
Mysql development
Install mysql and create test library
Create table
mysql> CREATE TABLE `user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(20) DEFAULT '', `age` int(11) DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
mysql> insert into user (name,age)va ...
Posted by programguru on Sat, 11 Apr 2020 16:17:34 +0200
Creating WebSocket service with Go language
Thank you for your reference- http://bjbsair.com/2020-04-01/tech-info/18504.html
Today, I introduce how to create WebSocket service with Go language. The first two parts of this article briefly introduce the WebSocket protocol and how to create WebSocket service with Go standard library. In the third part, we use the gorilla/websocket library ...
Posted by CAPTAINCAPSLOCK on Sun, 05 Apr 2020 09:03:45 +0200
Getting started with Go language
goroutine and channel
goroutine
Multithreading
func hello() {
//fmt.Printf("Hello Goroutine!!\n")
for i:=0;i<100;i++ {
fmt.Printf("hello:%d\n",i)
time.Sleep(time.Millisecond)
}
}
func main() {
go hello() //A separate thread has been started, alternating with the following code to make it a multithread
//fmt.Pr ...
Posted by jdog on Mon, 30 Mar 2020 12:36:39 +0200
[go learning notes] 9. Strings in go language
Character string
string is a data type, not a reference or pointer type
string is a read-only byte slice. The len function can get all the bytes
The byte array of string can hold any data
func TestString(t *testing.T) {
var s string
t.Log(s) //Initialize to default zero value ''
s = "hello"
t.Log(len(s))
//s[1] = '3' //str ...
Posted by syd on Fri, 20 Mar 2020 15:47:14 +0100
Go golang Foundation--func Function
Function function
The Go function does not support nesting, overloading, and default parameters
The following features are supported:
No prototype required, variable length parameters, multiple return values, named return value parameters, anonymous functions, closures
The definition function uses the keyword func and the left curly brace c ...
Posted by Japet on Fri, 21 Feb 2020 17:09:02 +0100
Go basis: process control if, switch, select, for
Catalog
Conditional statement if
Conditional statement switch
Type Switch
Conditional statement select
Syntax of select statement:
Typical use of select
1. Timeout judgment
2. exit
3. judge whether the channel is blocked
Loop statement for
Conditional statement if
Conditional statement ...
Posted by Hillary on Thu, 20 Feb 2020 01:58:28 +0100
[Code Page] Build your own golang framework step by step from scratch
The goal of this framework is to be a generic framework, and I want it to be big and complete, so I can use it directly as a foundation template for other projects in the future, so I want to continue adding some functionality to it, just write some demo in.For this article, I'll add a queue feature.
nsq
There are many queues, I choose nsq.The ...
Posted by sheckel on Mon, 17 Feb 2020 00:13:00 +0100