我试图安装我的一个 go 文件。但是我遇到了这个错误
C:\mygoproject>go install kafkapublisher.go
\#command-line-arguments
.\kafkapublisher.go:8:65: undefined: kafka.Message
.\kafkapublisher.go:10:19: undefined: kafka.NewProducer
.\kafkapublisher.go:10:38: undefined: kafka.ConfigMap
.\kafkapublisher.go:17:31: undefined: kafka.Event
.\kafkapublisher.go:19:26: undefined: kafka.Message
在我的 kafkapublisher.go 文件中,我已经导入了 kafka 依赖项:
import (
"github.com/confluentinc/confluent-kafka-go/kafka"
"log"
)
甚至在我的go.mod档案上
module mymodule
go 1.12
require (
github.com/aws/aws-lambda-go v1.15.0
github.com/confluentinc/confluent-kafka-go v1.3.0
)
我遵循了这个文档:https ://docs.confluent.io/current/clients/go.html
沧海一幻觉
慕勒3428872
慕森卡
相关分类