go 安装/版本切换
1. elastic beats 开发
1.1. 搭建开发环境
1.1.1. Go 版本
需要 Go 版本: 1.17+
。虽然官方文档说是 1.16
,但如果不用 1.17+
的话会报错: sf.IsExported undefined (type reflect.StructField has no field or method IsExported)
。
1.1.2. 下载代码
mkdir -p ${GOPATH}/src/github.com/elastic
git clone https://github.com/elastic/beats ${GOPATH}/src/github.com/elastic/beats