lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
275 stars 126 forks source link

How to run 1.6 cp example? #192

Closed ParkerOu closed 1 year ago

ParkerOu commented 1 year ago

I'm new to golang. How could I run 1.6 cp example? test version: latest main(3ecaf00b33b6b5f94c9e198cfc793b238297147c) and v0.16.0 golang version: go1.20.3 windows/amd64

Use Windows 10

go run .\example\1.6\cp\charge_point_sim.go

result:

# command-line-arguments
example\1.6\cp\charge_point_sim.go:74:67: undefined: ChargePointHandler
example\1.6\cp\charge_point_sim.go:79:2: undefined: checkError
example\1.6\cp\charge_point_sim.go:82:2: undefined: updateStatus
example\1.6\cp\charge_point_sim.go:87:2: undefined: checkError
example\1.6\cp\charge_point_sim.go:88:90: undefined: getExpiryDate
example\1.6\cp\charge_point_sim.go:90:2: undefined: updateStatus
example\1.6\cp\charge_point_sim.go:93:2: undefined: checkError
example\1.6\cp\charge_point_sim.go:94:133: undefined: getExpiryDate
example\1.6\cp\charge_point_sim.go:97:2: undefined: updateStatus
example\1.6\cp\charge_point_sim.go:100:59: undefined: MeterValueSampleInterval
example\1.6\cp\charge_point_sim.go:100:59: too many errors
UBT-FJ commented 1 year ago

I made it run like this: go run ./example/1.6/cp/*.go

lorenzodonini commented 1 year ago

The package is not found, most likely due to GOPATH issues. Maybe try running a go mod download && go build <example>.

You may also run the docker containers directly, if you just want to try out the functionality.

ParkerOu commented 1 year ago

The package is not found, most likely due to GOPATH issues. Maybe try running a go mod download && go build <example>.

Still the same error.

You may also run the docker containers directly, if you just want to try out the functionality.

Thanks for the replay. I'll try it with docker.