Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
refactor: unify naming
  • Loading branch information
aofei committed May 10, 2019
1 parent 76b7b04 commit 19c43f5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions handlers/goproxy.go
Expand Up @@ -166,7 +166,7 @@ func goproxyHandler(req *air.Request, res *air.Response) error {

switch filenameParts[1] {
case "v/list", "latest":
mlo, err := modList(req.Context, modulePath)
mlr, err := modList(req.Context, modulePath)
if err != nil {
if err == errModuleNotFound {
return a.NotFoundHandler(req, res)
Expand All @@ -177,10 +177,10 @@ func goproxyHandler(req *air.Request, res *air.Response) error {

switch filenameParts[1] {
case "v/list":
return res.WriteString(strings.Join(mlo.Versions, "\n"))
return res.WriteString(strings.Join(mlr.Versions, "\n"))
case "latest":
mlo.Versions = nil // No need
return res.WriteJSON(mlo)
mlr.Versions = nil // No need
return res.WriteJSON(mlr)
}
}

Expand Down Expand Up @@ -410,13 +410,13 @@ func modDownload(
return nil, err
}

filePrefix := path.Join(
filenamePrefix := path.Join(
encodeModulePathOrVersion(modulePath),
"@v",
encodeModulePathOrVersion(moduleVersion),
)

infoFilename := fmt.Sprint(filePrefix, ".info")
infoFilename := fmt.Sprint(filenamePrefix, ".info")
if err := uploadFile(
ctx,
infoFilename,
Expand All @@ -426,7 +426,7 @@ func modDownload(
return nil, err
}

modFilename := fmt.Sprint(filePrefix, ".mod")
modFilename := fmt.Sprint(filenamePrefix, ".mod")
if err := uploadFile(
ctx,
modFilename,
Expand All @@ -436,7 +436,7 @@ func modDownload(
return nil, err
}

zipFilename := fmt.Sprint(filePrefix, ".zip")
zipFilename := fmt.Sprint(filenamePrefix, ".zip")
if err := uploadFile(
ctx,
zipFilename,
Expand Down

0 comments on commit 19c43f5

Please sign in to comment.