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

x/net/trace: Example has errors #12387

Closed
tv42 opened this issue Aug 28, 2015 · 3 comments
Closed

x/net/trace: Example has errors #12387

tv42 opened this issue Aug 28, 2015 · 3 comments

Comments

@tv42
Copy link

tv42 commented Aug 28, 2015

        // A Fetcher fetches URL paths for a single domain.
    type Fetcher struct {
        domain string
        events *trace.EventLog
    }

That * was not meant to be there, pointers to interfaces are rare.

func (f *Fetcher) Fetch(path string) (string, error) {
    resp, err := http.Get("http://" + domain + "/" + path)

undefined: domain, should be f.domain

func (f *Fetcher) Fetch(path string) (string, error) {
...
    if err != nil {
        f.events.Errorf("Get(%q) = %v", path, err)
        return
    }

Needs to be return "", err

    f.events.Printf("Get(%q) = %s", path, resp.Code)

It's spelled StatusCode, but resp.Status is probably best for that.

Also needs to return something, or have ... there.

Same missing return in Fetcher.Close, add a return nil.

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Aug 29, 2015
@mikioh mikioh changed the title net/trace: Example has errors x/net/trace: Example has errors Aug 29, 2015
@mikioh mikioh modified the milestones: Unreleased, Unplanned Aug 29, 2015
@dvyukov
Copy link
Member

dvyukov commented Aug 29, 2015

@ianlancetaylor This does not seem to be my trace, it is some other trace. Or why am I assigned?

@dvyukov dvyukov removed their assignment Aug 29, 2015
@minux
Copy link
Member

minux commented Aug 29, 2015

see #12364, we really need a mechanism to automatically assign
issues to package owners.

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/14014 mentions this issue.

@golang golang locked and limited conversation to collaborators Sep 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants