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

Update client readme example to compile with previous API changes #607

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abecevello
Copy link
Member

Updates the full example in the client readme to compile. It was broken and didn't reflect the current API. I also removed an unnecessary example test that wasn't necessary to get a feel for how to use Toxiproxy.

Copy link

@mattbardal mattbardal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple of small suggestions but otherwise this looks good to me!

@@ -96,16 +96,15 @@ import (
"time"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small typo that can be fixed on line 23 here

Comment on lines -153 to -164
func TestEphemeralProxy(t *testing.T) {
proxy, _ := toxiClient.CreateProxy("test", "", "google.com:80")
defer proxy.Delete()

// Test connection through proxy.Listen
resp, err := http.Get("http://" + proxy.Listen)
if err != nil {
t.Fatal(err)
} else if resp.StatusCode != 200 {
t.Fatal("Proxy to google failed:", resp.StatusCode)
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're planning on cleaning up this test, we could probably get rid of the net/http import as well since this is the only test that uses it.

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 this pull request may close these issues.

2 participants