[Go] gocron source reading - slicing interface and type synthesis in go
// getCommands
func getCommands() []cli.Command {
command := cli.Command{
Name: "web",
Usage: "run web server",
Action: runWeb,
Flags: []cli.Flag{
cli.StringFlag{
Name: "host",
Value: "0.0.0.0",
Usage: "bind host",
},
...
Posted by andycole on Thu, 14 Nov 2019 18:52:34 +0100
Go in API planning directory and parameter validation
SummaryFirst, synchronize the following project overview:In the previous article, we used go modules to initialize the project. In this article, we share:Planning directory structureModel binding and validationCustom validatorMake API return structureDon't talk too much. Let's start.Planning directory structure
├─ go-gin-api
│ ├─ a ...
Posted by Dark_AngeL on Sat, 09 Nov 2019 21:34:01 +0100
Installing Jenkins on k8s and common problems
Continuous integration and deployment is an important part of DevOps. Jenkins is a very popular tool for continuous integration and deployment. Recently, I tested Jenkins and found that it is the most complex tool I have used for some time. One possible reason is that it needs to be integrated with various other tools to complete the task, and ...
Posted by indigo2k on Tue, 05 Nov 2019 08:22:34 +0100
30 min introduction to Go zero base
It has been more than two years since I unknowingly used Go to develop. The experience summary of the preparation point is convenient for later students to get started quickly.
outline
1. Go installation
2. Go ide building
3. Go modules module management
4. Go unit test
5. ...
Posted by DragonFire-N[R] on Wed, 23 Oct 2019 23:20:36 +0200
go regular expression
In the first two lessons, we used a lot of regular expressions to match the city list, city and user information. In fact, in addition to regular expressions to match, we can also use goquery and xpath third-party library to match useful information. And I used more elegant regular expression matching. Let's talk about regular expressions.
For ...
Posted by lilsim89 on Thu, 17 Oct 2019 20:48:22 +0200
An example in Go demonstrates the convenient processing and transformation of json's map and struct
Today, I'd like to talk a little bit about JSON data processing. In recent work, because we want to update the database data to elastic search in real time, we encounter some problems of JSON data processing in practice.
real-time data
The real-time data acquisition is realized by the open-source canal component of Alibaba, and transmitted to t ...
Posted by simjay on Wed, 16 Oct 2019 23:41:56 +0200
ECS uses docker to build services
Premise: Amazon cloud has been configured to start.
The inbound policy of security group is as follows:
The outbound strategy is as follows:
After logging in to EC2, only EC2 user can log in by default, and then switch to root:
sudo su
Prompt for installing docker no package docker available using yum.
yum install docker -y
resolvent:Add CentOS ...
Posted by Warmach on Wed, 16 Oct 2019 05:14:21 +0200
go json data forwarding
case
For example, there is a GET interface that allows batch access to user information (1)
> curl 'http://localhost:8080/user/1,2,3'
[
{
"user_id":1,
"other_suff":...
},
{
"user_id":2,
"other_suff":...
},
{
"user_id":3,
"other_suff":...
}
]
At the same time, we need to ...
Posted by sampledformat on Sun, 06 Oct 2019 05:29:57 +0200
GO Learning Notes - Template Rendering and Multiple Outputs
Theme of this article: Implementing Golang template rendering based on built-in text/template, and writing the results to files, screens and variables.
Little slow brother's original article, welcome to reprint.
Catalog
Defining StructuresDefine template textTemplate Rendering and Output ModeComplete examples
Defining Structures
First, defi ...
Posted by kerching on Tue, 01 Oct 2019 22:51:28 +0200
Exploration of slice's In function in Go
I was aware of the question before: Why doesn't Golang have the same functionality as in Python?So, after searching this question, we found that many people still have such questions.
Let's talk about this topic today.If you find this article helpful, thank you!
In is a very common function and may be called contains in some languages. Although ...
Posted by ntohky14 on Sun, 15 Sep 2019 06:00:05 +0200