Fixed lint issues, set Go version to 1.16.4

This commit is contained in:
Marc Ole Bulling
2021-05-07 17:15:12 +02:00
parent e6c3cfdc68
commit c8a019e22a
7 changed files with 9 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
FROM golang:1.16 AS build_base
FROM golang:1.16.4 AS build_base
## Usage:
## docker build . -t gokapi

View File

@@ -1,4 +1,4 @@
FROM golang:1.16
FROM golang:1.16.4
## To compile:
## cd Gokapi/build/

View File

@@ -6,4 +6,4 @@ type ApiKey struct {
FriendlyName string `json:"FriendlyName"`
LastUsed int64 `json:"LastUsed"`
LastUsedString string `json:"LastUsedString"`
}
}

View File

@@ -1,9 +1,10 @@
package models
// UploadRequest is used to set an upload request
type UploadRequest struct {
AllowedDownloads int
Expiry int
ExpiryTimestamp int64
ExpiryTimestamp int64
Password string
ExternalUrl string
}

View File

@@ -31,4 +31,4 @@ func TestSetUpgradeConfigFile(t *testing.T) {
WriteUpgradeConfigFile()
test.IsEqualBool(t, helper.FileExists(configFile), true)
TestDelete(t)
}
}

View File

@@ -38,6 +38,7 @@ func Process(w http.ResponseWriter, r *http.Request) {
}
}
// DeleteKey deletes the selected API key
func DeleteKey(id string) bool {
if !isValidKey(id, false) {
return false
@@ -48,6 +49,7 @@ func DeleteKey(id string) bool {
return true
}
// NewKey generates a new API key
func NewKey() string {
settings := configuration.GetServerSettings()
newKey := models.ApiKey{

View File

@@ -11,6 +11,7 @@ import (
"time"
)
// Process processes a file upload request
func Process(w http.ResponseWriter, r *http.Request, isWeb bool) error {
err := r.ParseMultipartForm(20 * 1024 * 1024)
if err != nil {