I was trying to install one of my go files. But I bumped into this error
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
On my kafkapublisher.go file, I already imported the kafka dependency:
import (
"github.com/confluentinc/confluent-kafka-go/kafka"
"log"
)
even on my go.mod
file
module mymodule
go 1.12
require (
github.com/aws/aws-lambda-go v1.15.0
github.com/confluentinc/confluent-kafka-go v1.3.0
)
I followed this documentation: https://docs.confluent.io/current/clients/go.html