dmitri.shuralyov.com/app/changes/...

githubapi: Infer the current user from client.
dmitshur committed 7 years ago commit 904a9805ecf3580ad653afb62902a6d83a8988b3
Collapse all
cmd/changesdev/main.go
@@ -31,11 +31,10 @@ import (
	"github.com/google/go-github/github"
	"github.com/gregjones/httpcache"
	"github.com/shurcooL/githubql"
	"github.com/shurcooL/httpgzip"
	"github.com/shurcooL/reactions/emojis"
	ghusers "github.com/shurcooL/users/githubapi"
	"golang.org/x/build/maintner/godata"
	"golang.org/x/oauth2"
)

var httpFlag = flag.String("http", ":8080", "Listen for HTTP connections on this address.")
@@ -77,12 +76,15 @@ func main() {
		}
		httpClient := &http.Client{Transport: cacheTransport}
		ghV3 := github.NewClient(httpClient)
		ghV4 := githubql.NewClient(httpClient)

		usersService := ghusers.NewService(ghV3)
		service = githubapi.NewService(ghV3, ghV4, nil, usersService)
		var err error
		service, err = githubapi.NewService(ghV3, ghV4, nil)
		if err != nil {
			log.Fatalln(err)
		}
	}

	changesOpt := changesapp.Options{
		HeadPre: `<style type="text/css">
	body {