diff --git a/.golangci.yaml b/.golangci.yaml index 377f2f1..2ee171b 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -6,7 +6,6 @@ linters: - durationcheck - errcheck - errorlint - - exportloopref - gci - gofmt - goimports diff --git a/main.go b/main.go index 61e3279..9234a9b 100644 --- a/main.go +++ b/main.go @@ -1,9 +1,9 @@ package main import ( - "fmt" "log" "os" + "strconv" "time" "github.com/joho/godotenv" @@ -23,11 +23,10 @@ func main() { _ = godotenv.Overload("/run/drone/env") } - year := fmt.Sprintf("%v", time.Now().Year()) app := cli.NewApp() app.Name = "Drone Discord" app.Usage = "Sending message to Discord channel using Webhook" - app.Copyright = "Copyright (c) " + year + " Bo-Yi Wu" + app.Copyright = "Copyright (c) " + strconv.Itoa(time.Now().Year()) + " Bo-Yi Wu" app.Authors = []*cli.Author{ { Name: "Bo-Yi Wu", diff --git a/plugin.go b/plugin.go index 7326a1f..4a5dfe8 100644 --- a/plugin.go +++ b/plugin.go @@ -163,7 +163,7 @@ func newfileUploadRequest(uri string, params map[string]string, paramName, path return nil, err } - req, err := http.NewRequest("POST", uri, body) + req, err := http.NewRequest(http.MethodPost, uri, body) req.Header.Set("Content-Type", writer.FormDataContentType()) return req, err }