Commit 28c9928c authored by Jacob Vosmaer's avatar Jacob Vosmaer

Declare params structs outside Inject functions

parent 46680f42
......@@ -21,16 +21,17 @@ import (
)
type archive struct{ senddata.Prefix }
type archiveParams struct {
RepoPath string
ArchivePath string
ArchivePrefix string
CommitId string
}
var SendArchive = &archive{"git-archive:"}
func (a *archive) Inject(w http.ResponseWriter, r *http.Request, sendData string) {
var params struct {
RepoPath string
ArchivePath string
ArchivePrefix string
CommitId string
}
var params archiveParams
if err := a.Unpack(&params, sendData); err != nil {
helper.Fail500(w, fmt.Errorf("SendArchive: unpack sendData: %v", err))
return
......
......@@ -10,11 +10,12 @@ import (
)
type blob struct{ senddata.Prefix }
type blobParams struct{ RepoPath, BlobId string }
var SendBlob = &blob{"git-blob:"}
func (b *blob) Inject(w http.ResponseWriter, r *http.Request, sendData string) {
var params struct{ RepoPath, BlobId string }
var params blobParams
if err := b.Unpack(&params, sendData); err != nil {
helper.Fail500(w, fmt.Errorf("SendBlob: unpack sendData: %v", err))
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment