Documentation
¶
Index ¶
- Constants
- func Command(command string, args []string) error
- func ExtractPackageArg(args []string) string
- func FindFirstGoGenerateLine(dir string) (targetPath string, targetNumber int, targetContent string, err error)
- func FindGoModFile(fromDir string) (string, error)
- func GetExternalIP() (string, error)
- func GetGoneVersionFromModuleFile(sanDir []string, scanFile []string) string
- func IsIPInChina(ip string) (bool, error)
- func IsInChina() bool
- func ParseModuleName(goModPath string) (string, error)
- func TimeStat(fn string) func()
- type ModuleInfo
Constants ¶
View Source
const GenerateBy = "// Code generated by gonectl. DO NOT EDIT."
Variables ¶
This section is empty.
Functions ¶
func ExtractPackageArg ¶
ExtractPackageArg 从命令行参数中提取 package 参数
func FindFirstGoGenerateLine ¶
func FindFirstGoGenerateLine(dir string) (targetPath string, targetNumber int, targetContent string, err error)
FindFirstGoGenerateLine 扫描目录,找到第一个匹配 //go:generate gonectl generate 的注释行
func FindGoModFile ¶
FindGoModFile 从指定目录向上逐层搜索 "go.mod" 文件
func ParseModuleName ¶
ParseModuleName 读取 go.mod 文件并解析出 module 名称
Types ¶
type ModuleInfo ¶
func FindModuleInfo ¶
func FindModuleInfo(dir string) (*ModuleInfo, error)
FindModuleInfo 获取当前目录所在的模块信息
Click to show internal directories.
Click to hide internal directories.