Browse Source

Fix gopls issues

master
Daan Sprenkels 2 months ago
parent
commit
b8d1ca459c
4 changed files with 4 additions and 17 deletions
  1. +2
    -2
      bindata.go
  2. +0
    -3
      fileupload.go
  3. +0
    -4
      handlers.go
  4. +2
    -8
      views.go

+ 2
- 2
bindata.go View File

@ -28,7 +28,7 @@ import (
func bindataRead(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err)
return nil, fmt.Errorf("read %q: %v", name, err)
}
var buf bytes.Buffer
@ -36,7 +36,7 @@ func bindataRead(data []byte, name string) ([]byte, error) {
clErr := gz.Close()
if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err)
return nil, fmt.Errorf("read %q: %v", name, err)
}
if clErr != nil {
return nil, err


+ 0
- 3
fileupload.go View File

@ -7,9 +7,6 @@ import (
"github.com/pkg/errors"
)
// Where to store the uploaded files
var fileStoreDir = ""
// FileUploadFileSystem is a HTTP filesystem handler
type FileUploadFileSystem struct {
fs http.FileSystem


+ 0
- 4
handlers.go View File

@ -45,8 +45,6 @@ const (
viewShowMeta
)
const cookieDeleteToken = "owner_token"
type canDelete uint
const (
@ -221,7 +219,6 @@ func (rl *rushlink) viewPasteHandlerInnerMeta(w http.ResponseWriter, r *http.Req
status = http.StatusOK
}
rl.render(w, r, status, "pasteMeta", data)
return
}
func (rl *rushlink) viewActionSuccess(w http.ResponseWriter, r *http.Request, p *db.Paste, fu *db.FileUpload) {
@ -244,7 +241,6 @@ func (rl *rushlink) viewActionSuccess(w http.ResponseWriter, r *http.Request, p
"CanDeleteBool": cd.Bool(),
}
rl.render(w, r, 0, "pasteMeta", data)
return
}
func (rl *rushlink) newPasteHandler(w http.ResponseWriter, r *http.Request) {


+ 2
- 8
views.go View File

@ -28,8 +28,8 @@ var textBaseTemplate *text.Template = text.Must(text.New("").Parse(string(MustAs
var htmlBaseTemplate *html.Template = html.Must(html.New("").Parse(string(MustAsset("templates/html/base.html.tmpl"))))
// Template collections
var textTemplates = make(map[string]*text.Template, 0)
var htmlTemplates = make(map[string]*html.Template, 0)
var textTemplates = make(map[string]*text.Template)
var htmlTemplates = make(map[string]*html.Template)
// Used by resolveResponseContentType
var acceptHeaderMediaRangeRegex = regexp.MustCompile(`^\s*([^()<>@,;:\\"/\[\]?.=]+)/([^()<>@,;:\\"/\[\]?.=]+)\s*$`)
@ -75,10 +75,6 @@ func mustMatch(pattern, name string) bool {
return m
}
func parseFail(tmplName string, err error) {
panic(errors.Wrapf(err, "parsing of %v failed", tmplName))
}
func mapExtend(m map[string]interface{}, key string, value interface{}) {
if m[key] != nil {
return
@ -191,10 +187,8 @@ func (rl *rushlink) resolveRootURL(r *http.Request) string {
switch forwardedScheme {
case "http":
scheme = "http"
break
case "https":
scheme = "https"
break
}
// Guess host
host := r.Host


Loading…
Cancel
Save