From 79e2de4b28526342a467f2ad33ba48a2f8d0adb4 Mon Sep 17 00:00:00 2001 From: Chris Hein Date: Wed, 4 Dec 2019 02:02:29 -0800 Subject: [PATCH] using repo name in go-source Signed-off-by: Chris Hein --- go-path-router/main.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/go-path-router/main.go b/go-path-router/main.go index a15541d..af5fe4c 100644 --- a/go-path-router/main.go +++ b/go-path-router/main.go @@ -14,13 +14,13 @@ import ( const tpl = ` + content="{{.Domain}}/{{.Repo}} + git https://{{.CodePath}}/{{.Repo}}"> + content="{{.Domain}}/{{.Repo}} + https://{{.CodePath}}/{{.Repo}} + https://{{.CodePath}}/{{.Repo}}/tree/master{/dir} + https://{{.CodePath}}/{{.Repo}}/blob/master{/dir}/{file}#L{line}"> @@ -32,7 +32,7 @@ type goHTMLData struct { Domain string CodePath string Path string - RepoPath string + Repo string } func handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { @@ -41,7 +41,7 @@ func handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyRespo Domain: os.Getenv("DOMAIN"), CodePath: os.Getenv("CODEPATH"), Path: request.Path, - RepoPath: pathsplit[1], + Repo: pathsplit[1], } t, err := template.New("index").Parse(tpl)