Fix golang lint errors (#2068)

* Fix golang lint errors

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Typo for fields

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Multi error fix

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Multi error fix

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Add nolint to logtostderr errcheck

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>
This commit is contained in:
Harsh Thakur
2021-06-15 15:03:42 +05:30
committed by GitHub
parent 377600d0a3
commit 6facdac464
19 changed files with 82 additions and 91 deletions
+4 -1
View File
@@ -175,7 +175,10 @@ func main() {
fmt.Printf("\nReceived signal %s, unsubscribing and closing connection...\n\n", sig.String())
// Do not unsubscribe a durable on exit, except if asked to.
if durable == "" || unsubscribe {
sub.Unsubscribe()
err := sub.Unsubscribe()
if err != nil {
log.Fatal(err)
}
}
sc.Close()
cleanupDone <- true
+6 -2
View File
@@ -2,15 +2,19 @@ package main
import (
"io/ioutil"
"log"
"net/http"
)
// Handler is the entry point for this fission function
func Handler(w http.ResponseWriter, r *http.Request) {
func Handler(w http.ResponseWriter, r *http.Request) { //nolint: deadcode
bytes, err := ioutil.ReadAll(r.Body)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
w.Write(bytes)
_, err = w.Write(bytes)
if err != nil {
log.Fatal(err)
}
}