Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix go dependencies #12

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/kuksa_go_client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ jobs:
go run protocInstall/protocInstall.go
export PATH=$PATH:$HOME/protoc/bin
sudo chmod +x $HOME/protoc/bin/protoc
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
# As we in protocInstall.go download a specific version of protoc we cannot use latest of the packages below
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
export PATH=$PATH:$HOME/go/bin
go generate .
go test .
Expand Down
9 changes: 9 additions & 0 deletions kuksa_go_client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,19 @@ if you use `apt`you must manually create a folder called `proto`
```

- Run the following command to install the needed GO protocol buffers plugins:

```
> go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
> go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
```

Your `protoc` may not be compatible with the latest version.
If so you may need to specify specific versions, the examples below works for `3.19`.
```
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
```

The plugins will be installed in $GOBIN, defaulting to $GOPATH/bin which is default HOME_DIR/go/bin. It must be in your $PATH for the protocol compiler protoc to find it.
For linux execute:
```
Expand Down
4 changes: 2 additions & 2 deletions kuksa_go_client/kuksa_client/commn.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (cc *KuksaClientCommWs) startCommunication() error {
if cc.Config.Insecure {
// Open an insecure websocket
serverUrl := url.URL{Scheme: "ws", Host: cc.Config.ServerAddress + ":" + cc.Config.ServerPort}
log.Printf("Connecting to " + serverUrl.String())
log.Printf("Connecting to %s", serverUrl.String())

// Connect to the Kuksa Websocket
var err error
Expand All @@ -94,7 +94,7 @@ func (cc *KuksaClientCommWs) startCommunication() error {
} else {
// Open a secure websocket
serverUrl := url.URL{Scheme: "wss", Host: cc.Config.ServerAddress + ":" + cc.Config.ServerPort}
log.Printf("Connecting to " + serverUrl.String())
log.Printf("Connecting to %s", serverUrl.String())

// Load Client cert
cert, err := tls.LoadX509KeyPair(cc.Config.CertsDir+"/Client.pem", cc.Config.CertsDir+"/Client.key")
Expand Down
2 changes: 1 addition & 1 deletion kuksa_go_client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func main() {
if err != nil {
log.Printf("Set Value Error: %v", err)
} else {
log.Printf("Vehicle.OBD.DTCList Set: " + valstr)
log.Printf("Vehicle.OBD.DTCList Set: %s", valstr)
}

values, err = backend.GetValueFromKuksaVal("Vehicle.OBD.DTCList", "value")
Expand Down