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
+11 -2
View File
@@ -16,6 +16,8 @@ limitations under the License.
package app
import (
"log"
"github.com/fission/fission/pkg/tracker"
"github.com/spf13/cobra"
)
@@ -49,6 +51,7 @@ func eventCommandHandler(cmd *cobra.Command, args []string) error {
return tracker.Tracker.SendEvent(event)
}
//EventCommand reports an event to analytics
func EventCommand() *cobra.Command {
eventCmd := &cobra.Command{
Use: "event",
@@ -61,7 +64,13 @@ func EventCommand() *cobra.Command {
persistentFlags.StringP("action", "a", "", "event action")
persistentFlags.StringP("label", "l", "", "event label")
persistentFlags.StringP("value", "v", "", "event value")
eventCmd.MarkPersistentFlagRequired("category")
eventCmd.MarkPersistentFlagRequired("action")
err := eventCmd.MarkPersistentFlagRequired("category")
if err != nil {
log.Fatal(err)
}
err = eventCmd.MarkPersistentFlagRequired("action")
if err != nil {
log.Fatal(err)
}
return eventCmd
}
+6 -1
View File
@@ -17,9 +17,14 @@ limitations under the License.
package main
import (
"log"
"github.com/fission/fission/cmd/reporter/app"
)
func main() {
app.App().Execute()
err := app.App().Execute()
if err != nil {
log.Fatal(err)
}
}