Beego Learning Notes 6: Paging Implementation

Implement Paging 1> Business logic for paging implementation 1->N data are displayed on each page. For the total number of data records M, the number of pages M%N==0?M/N:M/N+1; 2->Page Rendering Paging html Part 3>Switch pages, input parameters, background processing, and retrieve new eligible data 4>Paging method, js paging, and ...

Added by whare on Sun, 19 Jul 2020 17:37:26 +0300

04GORM source code interpretation

brief introduction query Query process Build query SQL statement Conditional statement Summary search structure Definition of search search method Summary summary brief introduction GORM source code interpretation, based on v1.9.11 edition. query In the previous section, we explored how models are defined and how data tables are creat ...

Added by champoi on Sun, 21 Jun 2020 12:01:47 +0300

Golang uses selenium to operate Chrome

Golang uses selenium to operate Chrome 1. Demand Solve the problem of automatic login, and solve the problem of crawler by the way. 2. Basic concepts Selenium: selenium is a tool for Web application testing. Selenium testing runs directly and automatically in the browser, just like real users operate manually. Webdriver: Chrome driver is an au ...

Added by Kold on Fri, 29 May 2020 04:15:44 +0300

gorm series - Update

Catalog Gorm update operation Update all fields Update modified fields Update selected fields No Hooks updates Batch update Update with SQL expression Modify values in Hooks Other update options Gorm update operation Update all fields Save() updates all fields of the object by default, even if you don't have an assignment. package main im ...

Added by deft on Mon, 27 Apr 2020 18:54:52 +0300

Source code interpretation of golang slice

This paper studies the creation, expansion and implementation of deep copy of golang slice from the perspective of source code. Internal data structure slice has only three fields, among which array is the part to save data, len field is the length and cap is the capacity. type slice struct { array unsafe.Pointer // Data section len in ...

Added by christine75 on Sun, 26 Apr 2020 12:40:56 +0300

[original] quick start to golang [9.3] - profound slicing skills

Preface What will the following program output? package mainimport "fmt"func f(s []string, level int) {        if level > 5 {               return        }        s = append(s, fmt.Sprint(level))        f(s, level+1)        fmt.Println("level:", level, "slice:", s)}func main() {        f(nil, 0)} Its output is: level: 5 slice: [0 1 2 3 4  ...

Added by tripc1 on Mon, 20 Apr 2020 14:13:45 +0300

Basic use and underlying principles of [go]map

1. map Basic Use map declaration var m4 map[int]int //Just declare there is no room m4[1]=100 //Report errors log.Println(m4) Establish //1 m3:=make(map[int]string,100) //Length can be specified log.Println(len(m3)) //Number of 0 key-value pairs m2:=make(map[string]string) //Use default length m2["you"] = "How do you do" log.Println(m2) // ...

Added by Lirpa on Wed, 15 Apr 2020 05:20:43 +0300

go language series -TCP programming

TCP programming One of the main design goals of Go is to face the large-scale back-end service program. Network communication is the server, and the program is an indispensable and vital part Basic introduction of network programming There are two kinds of network programming Tcp socket programming is the mainstream of network programming. It i ...

Added by kat89 on Wed, 08 Apr 2020 08:05:01 +0300

go language system - from file operation to unit test

Catalog File operation Input and output streams Open and close files Functions and methods used Case demonstration Read file operation application case Write file operation application case Judge whether the file exists Application example of file programming Copy file Count the number of English, numbers, spaces and other characters ...

Added by ctjansen on Wed, 08 Apr 2020 08:00:29 +0300

The Bible of Go language -- floating point exercises

Exercise 3.1: if the f function returns an unrestricted float64 value, the SVG file may output invalid polygon elements (although many SVG renderers will handle this properly). The modifier skips invalid polygons. Exercise 3.2: experiment with rendered graphics for other functions in the math package. Can you output an egg box, moguls or a sadd ...

Added by achintha on Sat, 04 Apr 2020 07:00:10 +0300