Skip to content

Commit

Permalink
fix golint
Browse files Browse the repository at this point in the history
  • Loading branch information
oiooj committed Apr 28, 2020
1 parent 94fcf94 commit ead1140
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
7 changes: 4 additions & 3 deletions proxy/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions proxy/server.go
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 2 additions & 1 deletion sumdb/handler.go
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down

0 comments on commit ead1140

Please sign in to comment.