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

zping example not compiling #641

Open
formula349 opened this issue Oct 22, 2024 · 5 comments · May be fixed by #642
Open

zping example not compiling #641

formula349 opened this issue Oct 22, 2024 · 5 comments · May be fixed by #642

Comments

@formula349
Copy link

Cloned the sdk repo on a linux machine. Tried running the steps in the README and always end up with this error. This is a 'go run', but the same happened with 'go install', which only worked after a 'go mod init zping' and 'go mod tidy'.

Is this example just too old to be run with current version of go?
 
`formula349@dev1:~/zitiapps/sdk-golang/example/zping$ go run .

github.com/openziti/transport/v2/proxies

../../../../go/pkg/mod/github.com/openziti/transport/v2@v2.0.146/proxies/http_connect.go:60:20: pfxlog.Logger().WithError undefined (type pfxlog.Builder has no field or method WithError)

github.com/openziti/identity/engines/parsec

../../../../go/pkg/mod/github.com/openziti/identity@v1.0.85/engines/parsec/parsec_engine.go:21:18: undefined: pfxlog.ContextLogger

github.com/openziti/sdk-golang/ziti/edge/posture

../../../../go/pkg/mod/github.com/openziti/sdk-golang@v0.23.44/ziti/edge/posture/cache.go:119:26: cannot use err (variable of type []error) as string value in argument to pfxlog.Logger().Error
f`

@dovholuknf
Copy link
Member

I'll take a peek

@dovholuknf
Copy link
Member

Ok, I didn't use the README on purpose just to see if it'd build how I normally do things and it does. I ran:

cd /tmp
git clone git@github.com:openziti/sdk-golang.git
cd sdk-golang/example/zping
go build ./...

After that, zping seems to work just fine:

./zping
zping replaces the function of icmp ping tool in a ziti network.
It provides an end to end latency measurement between any two ziti identities in
a ziti network and like icmp ping will provide the following metrics upon completion
of the ping session: min, max and mean latency and standard deviation as well as % loss.
zping uses the addressable terminator function of ziti to direct ping requests to
specific ziti identities.

Usage:
  zping [command]

Available Commands:
  client      zping client command
  completion  Generate the autocompletion script for the specified shell
  enroll      Enroll an identity
  help        Help about any command
  server      zping server command

Flags:
  -h, --help   help for zping

Use "zping [command] --help" for more information about a command.

I'd say we probably just need to make the readme better.

@dovholuknf
Copy link
Member

@formula349
Copy link
Author

Ok I removed the go.mod and go.sum that I created with go mod init and now I can build and run it. The go mod init was done because go install wouldn't work... Thank you.

@dovholuknf
Copy link
Member

cool. i'll close this issue then when the pr merges

@dovholuknf dovholuknf linked a pull request Oct 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants