go 包管理

新建一个go 程序 比如test.go

package main

import "github.com/astaxie/beego"

func main() {
    beego.Run()
}

在这个目录下运行 go mod init test
就会生成一个mod 文件

module hello

go 1.15

require github.com/astaxie/beego v1.12.3

每次添加新的包,运行程序都会更新

你可能感兴趣的:(go 包管理)