fix golint

pull/153/head
kun 2020-04-28 10:40:53 +08:00
parent 94fcf94f0a
commit ead1140c92
4 changed files with 11 additions and 5 deletions

View File

@ -1,5 +1,8 @@
# GOPROXY
# GOPROXY [![CircleCI](https://circleci.com/gh/goproxyio/goproxy.svg?style=svg)](https://circleci.com/gh/goproxyio/goproxy)
[![CircleCI](https://circleci.com/gh/goproxyio/goproxy.svg?style=svg)](https://circleci.com/gh/goproxyio/goproxy)
[![Go Report Card](https://goreportcard.com/badge/github.com/goproxyio/goproxy)](https://goreportcard.com/report/github.com/goproxyio/goproxy)
[![GoDoc](https://godoc.org/github.com/goproxyio/goproxy?status.svg)](https://godoc.org/github.com/goproxyio/goproxy)
A global proxy for go modules. see: [https://goproxy.io](https://goproxy.io)

View File

@ -19,9 +19,10 @@ import (
"github.com/goproxyio/goproxy/v2/sumdb"
)
// ListExpire list data expire data duration.
const ListExpire = 5 * time.Minute
// A RouterOps provides the proxy host and the external pattern
// RouterOptions provides the proxy host and the external pattern
type RouterOptions struct {
Pattern string
Proxy string
@ -103,6 +104,7 @@ func NewRouter(srv *Server, opts *RouterOptions) *Router {
return rt
}
// Direct decides whether a path should directly access.
func (rt *Router) Direct(path string) bool {
if rt.pattern == "" {
return false
@ -153,9 +155,8 @@ func (rt *Router) ServeHTTP(w http.ResponseWriter, r *http.Request) {
log.Printf("------ --- %s [proxy]\n", r.URL)
rt.proxy.ServeHTTP(w, r)
return
} else {
ctype = "text/plain; charset=UTF-8"
}
ctype = "text/plain; charset=UTF-8"
} else {
ext := path.Ext(what)
switch ext {

View File

@ -1,6 +1,7 @@
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package proxy implements the HTTP protocols for serving a Go module proxy.
package proxy

View File

@ -1,7 +1,8 @@
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package proxy implements the HTTP protocols for serving a Go module proxy.
// Package sumdb implements sumdb handler proxy.
package sumdb
import (