Error make build sdk-go

Hi Everyone,

I am following the guide about the creation of the device service but at the time of make build I get this result:

...

../../../../pkg/mod/github.com/edgexfoundry/device-sdk-go@v1.0.0/internal/clients/init.go:214:62: cannot use endpoint (type *endpoint.Endpoint) as type clients.Endpointer in argument to metadata.NewDeviceProfileClient:
        *endpoint.Endpoint does not implement clients.Endpointer (missing Fetch method)
../../../../pkg/mod/github.com/edgexfoundry/device-sdk-go@v1.0.0/internal/clients/init.go:221:46: cannot use endpoint (type *endpoint.Endpoint) as type clients.Endpointer in argument to coredata.NewEventClient:
        *endpoint.Endpoint does not implement clients.Endpointer (missing Fetch method)
../../../../pkg/mod/github.com/edgexfoundry/device-sdk-go@v1.0.0/internal/clients/init.go:225:66: cannot use endpoint (type *endpoint.Endpoint) as type clients.Endpointer in argument to coredata.NewValueDescriptorClient:
        *endpoint.Endpoint does not implement clients.Endpointer (missing Fetch method)
Makefile:18: recipe for target 'cmd/device-simple/device-simple' failed
make: *** [cmd/device-simple/device-simple] Error 2

I have repeated all the steps many times but I always get the same error.

The version of go I am using is 1.13.
Can someone kindly help me?

Thanks in advance…

This issue was resolved with https://github.com/edgexfoundry/device-sdk-go/issues/372.

Please make sure you fetch the latest code from master.

Hi @michaelestrin,

Thanks for the reply. I saw the topic about the problem and I’m using the latest updated version of go-mod-core-contracts, as you can see from the error output:

$ make build
CGO_ENABLED=0 GO111MODULE=on go build -ldflags "-X github.com/edgexfoundry/device-simple.Version=1.1.0" -o cmd/device-simple ./cmd/device-simple
go: finding github.com/edgexfoundry/go-mod-core-contracts v0.1.32
go: downloading github.com/edgexfoundry/go-mod-core-contracts v0.1.32
go: extracting github.com/edgexfoundry/go-mod-core-contracts v0.1.32
# github.com/edgexfoundry/device-sdk-go/internal/clients
../../../../pkg/mod/github.com/edgexfoundry/device-sdk-go@v1.0.0/internal/clients/init.go:202:58: cannot use endpoint (type *endpoint.Endpoint) as type clients.Endpointer in argument to metadata.NewAddressableClient:

I have another question: after typing the command:

GO111MODULE=on go mod init

Which generates the file go.mod should I modify the content inside? Currently, before executing make build, the content of the go.mod file is:

module github.com/edgexfoundry/device-simple

go 1.13

and I noticed that after the make build error, the go.mod file becomes:

module github.com/edgexfoundry/device-simple

go 1.13

require (
github.com/edgexfoundry/device-sdk-go v1.0.0
github.com/edgexfoundry/go-mod-core-contracts v0.1.32
)

Thanks again…