Fixed golangci-lint issues: /fission/pkg/router (#1831)

This commit is contained in:
Gaurav Gahlot
2020-11-03 16:15:50 +05:30
committed by GitHub
parent 2f23120a64
commit aaf9f18d93
11 changed files with 77 additions and 49 deletions
+5 -4
View File
@@ -12,21 +12,22 @@ import (
)
type (
// Analytics struct
// Analytics helps exporting usage metrics
Analytics struct {
id string
url string
}
// AnalyticsData struct
// AnalyticsData is the data exported as usage metrics
AnalyticsData struct {
ID string `json:"ID"`
FunctionCallCount uint64 `json:"FunctionCallCount"`
}
)
// MakeAnalytics returns Analytics if url is not empty
// MakeAnalytics returns a new instance of Analytics if url or
// 'ANALYTICS_URL' environment variable is set; nil otherwise
func MakeAnalytics(url string) *Analytics {
if len(url) == 0 {
url = os.Getenv("ANALYTICS_URL")
if len(url) == 0 {