...
if p.extensions&DefinitionLists != 0 {
if i < len(data)-1 && data[i+1] == ':' {
listLen := p.list(data[prev:], ast.ListTypeDefinition, 0, '.')
return prev + listLen
}
}
...
...
if p.extensions&DefinitionLists != 0 {
if i < len(data)-1 && data[i+1] == ':' {
listLen := p.list(data[prev:], ast.ListTypeDefinition, 0, '.')
return prev + listLen
if listLen > 0 {
return prev + listLen
}
}
}
...
ub20@ub20:~$ wget https://go.dev/dl/go1.23.0.linux-amd64.tar.gz
ub20@ub20:~$ sudo tar -C /usr/local -xzf ./go1.23.0.linux-amd64.tar.gz
#添加环境变量
ub20@ub20:~$ vim ~/.bashrc
#内容
# GOROOT:go的安装路径
export GOROOT="/usr/local/go"
# GOPATH:go的开发路径(自定义就好)
export GOPATH="/home/ub20/gowork"
# GOBIN:go工具程序存放路径
export GOBIN=$GOPATH/bin
export PATH=$PATH:${GOPATH//://bin:}/bin:/usr/local/go/bin
ub20@ub20:~$ source ~/.bashrc
#创建工作目录
ub20@ub20:~$ mkdir gowork
ub20@ub20:~$ cd ./gowork/
ub20@ub20:~/gowork$ mkdir bin
ub20@ub20:~/gowork$ mkdir src
ub20@ub20:~/gowork$ mkdir pkg
#解决网络代理问题
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct
$ go install github.com/dvyukov/go-fuzz/go-fuzz@latest github.com/dvyukov/go-fuzz/go-fuzz-build@latest
#创建要魔改的go-fuzz
mkdir -p $GOPATH/src/github.com/dvyukov/go-fuzz
#下载源码,后可以魔改
git clone https://github.com/dvyukov/go-fuzz.git $GOPATH/src/github.com/dvyukov/go-fuzz
#进入go-fuzz目录进行初始化
#进入源码目录配置go.mod
cd $GOPATH/src/github.com/dvyukov/go-fuzz
go mod init
#安装go-fuzz所需依赖
go get github.com/elazarl/go-bindata-assetfs
go get github.com/stephens2424/writerset
go get golang.org/x/tools/go/packages
cd $GOPATH/src/github.com/dvyukov/go-fuzz
#安装go-fuzz的编译工具
ub20@ub20:~/gowork/src/github.com/dvyukov/go-fuzz$ go build -o go-fuzz-build ./go-fuzz-build
ub20@ub20:~/gowork/src/github.com/dvyukov/go-fuzz$ ./go-fuzz-build/go-fuzz-build --help
#安装go-fuzz的运行工具
ub20@ub20:~/gowork/src/github.com/dvyukov/go-fuzz$ go build -o go-fuzz ./go-fuzz
ub20@ub20:~/gowork/src/github.com/dvyukov/go-fuzz$ ./go-fuzz/go-fuzz --help
#将两个工具安装至环境变量
ub20@ub20:~/gowork/src/github.com/dvyukov/go-fuzz$ go install ./go-fuzz
ub20@ub20:~/gowork/src/github.com/dvyukov/go-fuzz$ go install ./go-fuzz-build