当前位置:首页>学习笔记>Golang 基础学习笔记

Golang 基础学习笔记

  • 2026-05-02 18:53:09
Golang 基础学习笔记

🚀 Golang 基础学习笔记

📑 目录

  1. 🗂️ Go 语言简介
  2. ⚙️ 开发环境搭建
  3. 📝 第一个 Go 程序
  4. 📖 基本语法
  5. 🔢 数据类型
  6. 🔄 控制流程
  7. ⚡ 函数
  8. 📦 包和模块
  9. 🏗️ 结构体和方法
  10. 🔌 接口
  11. 🔥 并发编程
  12. ⚠️ 错误处理
  13. 📚 常用标准库

1. 🗂️ Go 语言简介

1.1 什么是 Go

Go(又称 Golang)是 Google 开发的一种静态类型、编译型、并发式编程语言,于 2009 年正式发布。

1.2 Go 的特点

  • 💨 简洁高效:语法简洁,学习曲线平缓
  • ⚡ 高性能:编译成机器码,执行效率高
  • 🔀 并发支持:原生支持 goroutine 和 channel
  • 🧹 垃圾回收:自动内存管理
  • 🌍 跨平台:支持多平台编译
  • 🔒 静态类型:编译时类型检查,安全性高

1.3 Go 的应用场景

  • 🖥️ 服务器端开发
  • ☸️ 云原生/容器化应用(Docker、Kubernetes)
  • 🌐 网络编程
  • 🔗 分布式系统
  • 💻 命令行工具
  • 🏛️ 微服务架构

2. ⚙️ 开发环境搭建

2.1 安装 Go

🍎 macOS(使用 Homebrew):

brew install go

🪟 Windows(使用 winget):

winget install GoLang.Go

✅ 验证安装:

go version

2.2 IDE 推荐

  • 📝 VS Code:安装 Go 扩展
  • 💎 GoLand:JetBrains 出品,功能强大
  • 📠 Vim/Neovim:安装 vim-go 插件

2.3 GOPATH 与 Go Modules

从 Go 1.11 开始,推荐使用 Go Modules 管理依赖:

# 初始化模块go mod init module_name# 下载依赖go mod tidy

3. 📝 第一个 Go 程序

3.1 Hello World

创建文件 main.go

package mainimport"fmt"funcmain() {    fmt.Println("Hello, World!")}

3.2 运行程序

# 编译并运行go run main.go# 编译为可执行文件go build main.go./main

4. 📖 基本语法

4.1 变量声明

// 方法一:声明并初始化var name string = "Alice"// 方法二:类型推断var age = 25// 方法三:短变量声明(函数内)city := "Beijing"// 声明多个变量var (    firstName string = "John"    lastName  string = "Doe")

4.2 常量

const PI = 3.14159const (    StatusOK    = 200    StatusNotFound = 404)

4.3 注释

// 单行注释/* 多行 注释*/

5. 🔢 数据类型

5.1 基础类型

// 布尔类型var isActive bool = true// 整数var a int = 10// 有符号整数var b int8 = 127// 8位有符号整数var c int16 = 32767// 16位有符号整数var d int32 = 2147483647var e int64 = 9223372036854775807// 无符号整数var f uint = 10var g uint8 = 255var h uint16 = 65535var i uint32 = 4294967295var j uint64 = 18446744073709551615// 浮点数var k float32 = 3.14var l float64 = 3.141592653589793// 复数var m complex64 = complex(12)var n complex128 = complex(12)// 字节和字符var o byte = 'A'var p rune = '中'// 字符串var q string = "Hello, Go!"

5.2 派生类型

// 数组var arr [5]int = [5]int{12345}// 切片(动态数组)slice := []int{12345}// 映射(字典)m := map[string]int{"apple":  5,"banana"3,}// 指针ptr := &arr[0]// 结构体type Person struct {    Name string    Age  int}

5.3 类型转换

var i int = 42var f float64 = float64(i)var u uint = uint(i)

6. 🔄 控制流程

6.1 if 条件语句

score := 85if score >= 90 {    fmt.Println("优秀")elseif score >= 60 {    fmt.Println("及格")else {    fmt.Println("不及格")}// 条件判断前可以赋值if age := 20; age >= 18 {    fmt.Println("成年")}

6.2 for 循环

// 基本形式for i := 0; i < 10; i++ {    fmt.Println(i)}// 省略初始值和递增i := 0for i < 10 {    i++}// 无限循环for {// ...if condition {break    }}// range 遍历nums := []int{12345}for index, value := range nums {    fmt.Printf("Index: %d, Value: %d\n", index, value)}

6.3 switch 语句

day := "Monday"switch day {case"Monday""Tuesday""Wednesday""Thursday""Friday":    fmt.Println("工作日")case"Saturday""Sunday":    fmt.Println("周末")default:    fmt.Println("无效的日期")}// switch 后不跟表达式,行为类似 if-elsescore := 85switch {case score >= 90:    fmt.Println("A")case score >= 80:    fmt.Println("B")case score >= 60:    fmt.Println("C")default:    fmt.Println("D")}

6.4 跳转语句

// break:跳出循环for i := 0; i < 10; i++ {if i == 5 {break    }    fmt.Println(i)}// continue:跳过本次迭代for i := 0; i < 5; i++ {if i == 2 {continue    }    fmt.Println(i)}// goto:跳转到标签(慎用)goto Label// ...Label:fmt.Println("jump here")

7. ⚡ 函数

7.1 基本函数

// 无返回值funcgreet(name string) {    fmt.Printf("Hello, %s!\n", name)}// 单返回值funcadd(a, b int)int {return a + b}// 多返回值funcdivide(a, b int)(int, error) {if b == 0 {return0, errors.New("除数不能为零")    }return a / b, nil}// 命名返回值funcswap(a, b int)(x int, y int) {    x = b    y = areturn// 裸返回}

7.2 可变参数

funcsum(nums ...int)int {    total := 0for _, n := range nums {        total += n    }return total}funcmain() {    fmt.Println(sum(12345)) // 输出: 15}

7.3 匿名函数与闭包

// 匿名函数add := func(a, b int)int {return a + b}fmt.Println(add(12))// 闭包funccounter()func()int {    count := 0returnfunc()int {        count++return count    }}funcmain() {    next := counter()    fmt.Println(next()) // 1    fmt.Println(next()) // 2    fmt.Println(next()) // 3}

7.4 函数作为参数和返回值

funcapply(op func(intint)intabintint {return op(a, b)}funcmultiply(a, b int)int {return a * b}funcmain() {    result := apply(multiply, 34)    fmt.Println(result) // 12}

8. 📦 包和模块

8.1 包的概念

Go 程序由包组成,每个文件开头声明包名:

package main  // 主包package utils  // 自定义包

8.2 导入包

import ("fmt"// 标准库"math"// 标准库"github.com/package"// 第三方包    mypackage " ./mypackage"// 本地包(使用别名))

8.3 init 函数

每个包可以有一个 init() 函数,在包被导入时自动执行:

package utilsimport"fmt"funcinit() {    fmt.Println("utils package initialized")}

8.4 Go Modules

# 初始化模块go mod init github.com/username/project# 添加依赖go get github.com/pkg/errors# 更新依赖go get -u all# 整理依赖go mod tidy# 下载依赖到本地go mod download# 查看依赖go list -m allgo mod graph

9. 🏗️ 结构体和方法

9.1 定义结构体

type Person struct {    Name    string    Age     int    Email   string    Address string}

9.2 创建和初始化结构体

// 方式一:按字段名p1 := Person{    Name:  "Alice",    Age:   30,    Email: "alice@example.com",}// 方式二:按字段顺序p2 := Person{"Bob"25"bob@example.com"""}// 方式三:使用 newp3 := new(Person)p3.Name = "Charlie"

9.3 方法

type Rectangle struct {    Width  float64    Height float64}// 值接收者方法func(r Rectangle)Area()float64 {return r.Width * r.Height}// 指针接收者方法func(r *Rectangle)Scale(factor float64) {    r.Width *= factor    r.Height *= factor}// 链式调用示例func(r Rectangle)SetWidth(width float64)Rectangle {    r.Width = widthreturn r}

9.4 结构体嵌套和继承

type Address struct {    City    string    Country string}type Employee struct {    Name    string    Salary  float64    Address        // 匿名嵌套(组合)}funcmain() {    emp := Employee{        Name:   "Alice",        Salary: 5000,        Address: Address{            City:    "Beijing",            Country: "China",        },    }    fmt.Println(emp.City) // 直接访问嵌套字段}

10. 🔌 接口

10.1 定义接口

type Writer interface {    Write([]byte) (int, error)}type Reader interface {    Read([]byte) (int, error)}// 多个方法的接口type ReadWriter interface {    Reader    Writer}

10.2 实现接口

在 Go 中,只要类型实现了接口的所有方法,就隐式实现了该接口:

type Integer intfunc(i Integer)String()string {return strconv.Itoa(int(i))}type Stringer interface {    String() string}funcprintString(s Stringer) {    fmt.Println(s.String())}funcmain() {var i Integer = 42    printString(i)}

10.3 空接口

// 空接口可以存储任何值var any interface{} = "hello"any = 42any = []int{123}// 类型断言str, ok := any.(string)if ok {    fmt.Println(str)}// switch 类型判断switch v := any.(type) {casestring:    fmt.Println("string:", v)caseint:    fmt.Println("int:", v)default:    fmt.Println("unknown type")}

10.4 常用内置接口

// Stringer 接口type Stringer interface {    String() string}// Error 接口type error interface {    Error() string}// Go 中的接口(隐式实现)// sort.Interface 需要实现 Len(), Less(), Swap()

11. 🔥 并发编程

11.1 Goroutine

goroutine 是 Go 轻量级的线程,由 Go 运行时管理:

funcsay(s string) {for i := 0; i < 5; i++ {        fmt.Println(s)    }}funcmain() {// 并发执行go say("world")    say("hello")}

11.2 Channel

channel 用于 goroutine 之间的通信:

// 创建 channelch := make(chanint)// 发送数据gofunc() {    ch <- 42}()// 接收数据value := <-chfmt.Println(value)// 关闭 channelclose(ch)// 带缓冲的 channelbuffered := make(chanint10)// 单向 channelsendOnly := make(chan<- int)recvOnly := make(<-chanint)

11.3 Select

select 用于监听多个 channel 的 IO 操作:

funcmain() {    ch1 := make(chanint)    ch2 := make(chanint)gofunc() {        time.Sleep(1 * time.Second)        ch1 <- 1    }()gofunc() {        time.Sleep(2 * time.Second)        ch2 <- 2    }()for i := 0; i < 2; i++ {select {case msg1 := <-ch1:            fmt.Println("Received from ch1:", msg1)case msg2 := <-ch2:            fmt.Println("Received from ch2:", msg2)case <-time.After(3 * time.Second):            fmt.Println("Timeout")        }    }}

11.4 并发安全

// 使用 sync.Mutexvar mu sync.Mutexvar counter intfuncincrement() {    mu.Lock()    counter++    mu.Unlock()}// 使用 sync.WaitGroupvar wg sync.WaitGroupfuncworker(id int) {defer wg.Done()    fmt.Printf("Worker %d starting\n", id)    time.Sleep(time.Second)    fmt.Printf("Worker %d done\n", id)}funcmain() {for i := 1; i <= 5; i++ {        wg.Add(1)go worker(i)    }    wg.Wait()}// 使用 sync.Map(并发安全的 map)var safeMap sync.MapsafeMap.Store("key""value")value, ok := safeMap.Load("key")

11.5 Context

import"context"funcworkerWithContext(ctx context.Context) {for {select {case <-ctx.Done():            fmt.Println("Worker stopped:", ctx.Err())returndefault:            fmt.Println("Working...")            time.Sleep(500 * time.Millisecond)        }    }}funcmain() {    ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)defer cancel()    workerWithContext(ctx)}

12. ⚠️ 错误处理

12.1 Go 的错误处理哲学

Go 使用返回错误值的方式处理错误,而不是异常机制:

// 错误接口type error interface {    Error() string}// 标准库 errorsimport"errors"funcdivide(a, b float64)(float64, error) {if b == 0 {return0, errors.New("division by zero")    }return a / b, nil}funcmain() {    result, err := divide(100)if err != nil {        fmt.Println("Error:", err)return    }    fmt.Println("Result:", result)}

12.2 自定义错误

type MyError struct {    Code    int    Message string}func(e *MyError)Error()string {return fmt.Sprintf("Error %d: %s", e.Code, e.Message)}funcdivide(a, b float64)(float64, error) {if b == 0 {return0, &MyError{Code: 1001, Message: "division by zero"}    }return a / b, nil}

12.3 错误链

import"fmt"funcreadFile(filename string)error {return fmt.Errorf("failed to read file: %w", os.ErrNotExist)}funcprocessData(filename string)error {    err := readFile(filename)if err != nil {return fmt.Errorf("process failed: %w", err)    }returnnil}funcmain() {    err := processData("nonexistent.txt")if err != nil {        fmt.Printf("Error: %v\n", err)// 使用 errors.Is 检查错误链if errors.Is(err, os.ErrNotExist) {            fmt.Println("File does not exist")        }    }}

12.4 panic 和 recover

funcsafeCall() {deferfunc() {if r := recover(); r != nil {            fmt.Println("Recovered from panic:", r)        }    }()panic("something went wrong")}funcmain() {    safeCall()    fmt.Println("Program continues...")}

13. 📚 常用标准库

13.1 fmt - 格式化 I/O

import"fmt"funcmain() {// 打印    fmt.Println("Hello, World!")    fmt.Printf("Name: %s, Age: %d\n""Alice"30)    fmt.Sprintf("Pi: %.2f"3.14159)// 格式化占位符// %v  默认格式// %+v 打印结构体时加字段名// %#v 打印 Go 语法表示// %T  打印类型// %d  十进制// %x  十六进制// %s  字符串// %f  浮点数}

13.2 strings - 字符串操作

import"strings"funcmain() {    s := "Hello, World!"    strings.Contains(s, "World")    // true    strings.Split(s, ",")           // [Hello  World!]    strings.Join([]string{"a","b"}, "-"// a-b    strings.ToUpper(s)               // HELLO, WORLD!    strings.ToLower(s)               // hello, world!    strings.TrimSpace("  hello  ")  // hello    strings.Replace(s, "World""Go"1)    strings.HasPrefix(s, "Hello")    // true    strings.HasSuffix(s, "!")        // true    strings.Index(s, "World")        // 7    strings.Count(s, "o")            // 2}

13.3 strconv - 类型转换

import"strconv"funcmain() {// 字符串转数字    i, _ := strconv.Atoi("42")    i64, _ := strconv.ParseInt("42"1064)// 数字转字符串    s := strconv.Itoa(42)    s = strconv.FormatInt(4210)// 字符串转布尔值    b, _ := strconv.ParseBool("true")// 格式化    s = strconv.FormatFloat(3.14159'f'264)  // 3.14}

13.4 time - 时间处理

import"time"funcmain() {// 获取当前时间    now := time.Now()// 时间格式化    fmt.Println(now.Format("2006-01-02 15:04:05"))// 时间戳    unix := now.Unix()    unixMilli := now.UnixMilli()// 解析时间    t, _ := time.Parse("2006-01-02""2024-01-01")// 时间运算    tomorrow := now.Add(24 * time.Hour)    diff := tomorrow.Sub(now)// 定时器    ticker := time.NewTicker(1 * time.Second)    <-ticker.C// 睡眠    time.Sleep(2 * time.Second)}

13.5 os - 操作系统功能

import"os"funcmain() {// 文件操作    file, err := os.Create("test.txt")    data := []byte("Hello, Go!")    file.Write(data)    file.Close()// 读取文件    content, err := os.ReadFile("test.txt")// 目录操作    os.Mkdir("dir"0755)    os.MkdirAll("dir/subdir"0755)// 删除    os.Remove("test.txt")    os.RemoveAll("dir")// 环境变量    os.Getenv("PATH")    os.Setenv("KEY""value")// 命令行参数    args := os.Args// 退出程序    os.Exit(0)}

13.6 json - JSON 序列化

import"encoding/json"type Person struct {    Name  string`json:"name"`    Age   int`json:"age"`    Email string`json:"email,omitempty"`}funcmain() {// 结构体转 JSON    p := Person{Name: "Alice", Age: 30}    jsonData, _ := json.Marshal(p)    fmt.Println(string(jsonData))// 带缩进的 JSON    jsonData, _ = json.MarshalIndent(p, """  ")// JSON 转结构体    jsonStr := `{"name":"Bob","age":25}`var p2 Person    json.Unmarshal([]byte(jsonStr), &p2)// Map 转 JSON    m := map[string]interface{}{"name""Charlie","age":  28,    }    jsonData, _ = json.Marshal(m)}

13.7 log - 日志

import"log"funcmain() {// 基本日志    log.Println("This is a log message")    log.Printf("User %s logged in""Alice")// 设置日志格式    log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)// 设置输出位置    log.SetOutput(os.Stdout)// Fatal 会打印日志并退出程序    log.Fatal("Fatal error")// Panic 会打印日志并触发 panic    log.Panic("Panic error")}

📝 练习建议

  1. 🧮 基础练习:实现一个计算器,支持加减乘除运算
  2. 🗃️ 数据结构:实现栈、队列等数据结构
  3. 📄 文件处理:实现文件复制、文本搜索等功能
  4. 🔀 并发练习:实现生产者-消费者模型
  5. 🌐 HTTP 服务:使用 net/http 实现简单的 REST API
  6. 📱 项目实战:开发一个命令行 Todo 应用

📖 参考资源

  • 📘 Go 官方文档
  • 🇨🇳 Go 语言中文文档
  • 📗 Go 标准库文档
  • 📙 Go by Example

笔记更新时间:2026年5月

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-05-02 20:15:11 HTTP/2.0 GET : https://67808.cn/a/485678.html
  2. 运行时间 : 0.084231s [ 吞吐率:11.87req/s ] 内存消耗:4,497.05kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=db5d1a3b41015a8414096f8118fc41e5
  1. /yingpanguazai/ssd/ssd1/www/no.67808.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/no.67808.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/no.67808.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/no.67808.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/no.67808.cn/runtime/temp/6df755f970a38e704c5414acbc6e8bcd.php ( 12.06 KB )
  140. /yingpanguazai/ssd/ssd1/www/no.67808.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000477s ] mysql:host=127.0.0.1;port=3306;dbname=no_67808;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000568s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000242s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000277s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000476s ]
  6. SELECT * FROM `set` [ RunTime:0.000199s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000595s ]
  8. SELECT * FROM `article` WHERE `id` = 485678 LIMIT 1 [ RunTime:0.000481s ]
  9. UPDATE `article` SET `lasttime` = 1777724111 WHERE `id` = 485678 [ RunTime:0.003671s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 65 LIMIT 1 [ RunTime:0.003304s ]
  11. SELECT * FROM `article` WHERE `id` < 485678 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000489s ]
  12. SELECT * FROM `article` WHERE `id` > 485678 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000420s ]
  13. SELECT * FROM `article` WHERE `id` < 485678 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.002111s ]
  14. SELECT * FROM `article` WHERE `id` < 485678 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001780s ]
  15. SELECT * FROM `article` WHERE `id` < 485678 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.002980s ]
0.085848s