Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Commit

Permalink
gosrc: add missing context parameters to print.go
Browse files Browse the repository at this point in the history
Support for the context package was added in baa18d8, but the
gosrc/print.go debug utility was never updated, and since it has the
ignore build tag go test etc. didn't catch this.

This will not affect godoc.org operation; it's just a debug utility for
developers; it was helpful for me in examining #576.

Change-Id: Ie48ede8b1a54289d5dd848c4ca7867fd9ca38a02
GitHub-Last-Rev: ad319e6
GitHub-Pull-Request: #577
Reviewed-on: https://go-review.googlesource.com/132655
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
  • Loading branch information
arp242 authored and dmitshur committed Sep 5, 2018
1 parent 96d2a28 commit 656e7e1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gosrc/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
package main

import (
"context"
"flag"
"fmt"
"log"
Expand Down Expand Up @@ -54,7 +55,7 @@ func printDir(path string) {
GithubClientSecret: os.Getenv("GITHUB_CLIENT_SECRET"),
},
}
dir, err := gosrc.Get(c, path, *etag)
dir, err := gosrc.Get(context.Background(), c, path, *etag)
if e, ok := err.(gosrc.NotFoundError); ok && e.Redirect != "" {
log.Fatalf("redirect to %s", e.Redirect)
} else if err != nil {
Expand All @@ -78,7 +79,7 @@ func printDir(path string) {
}

func printPresentation(path string) {
pres, err := gosrc.GetPresentation(http.DefaultClient, path)
pres, err := gosrc.GetPresentation(context.Background(), http.DefaultClient, path)
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 656e7e1

Please sign in to comment.