Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
8e9c0a44
Unverified
Commit
8e9c0a44
authored
Oct 01, 2018
by
Carl Bergquist
Committed by
GitHub
Oct 01, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13470 from mjtrangoni/fix-megacheck-issues
Fix megacheck issues
parents
505ae709
6c190ab7
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
3 additions
and
73 deletions
+3
-73
pkg/api/avatar/avatar.go
+0
-9
pkg/api/folder_test.go
+0
-10
pkg/api/live/hub.go
+0
-3
pkg/cmd/grafana-server/main.go
+1
-1
pkg/components/imguploader/azureblobuploader.go
+0
-2
pkg/middleware/middleware_test.go
+0
-5
pkg/services/alerting/ticker.go
+0
-4
pkg/services/notifications/notifications_test.go
+0
-6
pkg/services/sqlstore/dashboard_service_integration_test.go
+0
-23
pkg/services/sqlstore/transactions_test.go
+0
-4
pkg/tsdb/cloudwatch/credentials.go
+1
-2
pkg/tsdb/stackdriver/stackdriver_test.go
+1
-4
No files found.
pkg/api/avatar/avatar.go
View file @
8e9c0a44
...
@@ -97,15 +97,6 @@ type CacheServer struct {
...
@@ -97,15 +97,6 @@ type CacheServer struct {
cache
*
gocache
.
Cache
cache
*
gocache
.
Cache
}
}
func
(
this
*
CacheServer
)
mustInt
(
r
*
http
.
Request
,
defaultValue
int
,
keys
...
string
)
(
v
int
)
{
for
_
,
k
:=
range
keys
{
if
_
,
err
:=
fmt
.
Sscanf
(
r
.
FormValue
(
k
),
"%d"
,
&
v
);
err
==
nil
{
defaultValue
=
v
}
}
return
defaultValue
}
func
(
this
*
CacheServer
)
Handler
(
ctx
*
macaron
.
Context
)
{
func
(
this
*
CacheServer
)
Handler
(
ctx
*
macaron
.
Context
)
{
urlPath
:=
ctx
.
Req
.
URL
.
Path
urlPath
:=
ctx
.
Req
.
URL
.
Path
hash
:=
urlPath
[
strings
.
LastIndex
(
urlPath
,
"/"
)
+
1
:
]
hash
:=
urlPath
[
strings
.
LastIndex
(
urlPath
,
"/"
)
+
1
:
]
...
...
pkg/api/folder_test.go
View file @
8e9c0a44
...
@@ -133,16 +133,6 @@ func TestFoldersApiEndpoint(t *testing.T) {
...
@@ -133,16 +133,6 @@ func TestFoldersApiEndpoint(t *testing.T) {
})
})
}
}
func
callGetFolderByUID
(
sc
*
scenarioContext
)
{
sc
.
handlerFunc
=
GetFolderByUID
sc
.
fakeReqWithParams
(
"GET"
,
sc
.
url
,
map
[
string
]
string
{})
.
exec
()
}
func
callDeleteFolder
(
sc
*
scenarioContext
)
{
sc
.
handlerFunc
=
DeleteFolder
sc
.
fakeReqWithParams
(
"DELETE"
,
sc
.
url
,
map
[
string
]
string
{})
.
exec
()
}
func
callCreateFolder
(
sc
*
scenarioContext
)
{
func
callCreateFolder
(
sc
*
scenarioContext
)
{
sc
.
fakeReqWithParams
(
"POST"
,
sc
.
url
,
map
[
string
]
string
{})
.
exec
()
sc
.
fakeReqWithParams
(
"POST"
,
sc
.
url
,
map
[
string
]
string
{})
.
exec
()
}
}
...
...
pkg/api/live/hub.go
View file @
8e9c0a44
...
@@ -37,9 +37,6 @@ func newHub() *hub {
...
@@ -37,9 +37,6 @@ func newHub() *hub {
}
}
}
}
func
(
h
*
hub
)
removeConnection
()
{
}
func
(
h
*
hub
)
run
(
ctx
context
.
Context
)
{
func
(
h
*
hub
)
run
(
ctx
context
.
Context
)
{
for
{
for
{
select
{
select
{
...
...
pkg/cmd/grafana-server/main.go
View file @
8e9c0a44
...
@@ -104,7 +104,7 @@ func listenToSystemSignals(server *GrafanaServerImpl) {
...
@@ -104,7 +104,7 @@ func listenToSystemSignals(server *GrafanaServerImpl) {
for
{
for
{
select
{
select
{
case
_
=
<-
sighupChan
:
case
<-
sighupChan
:
log
.
Reload
()
log
.
Reload
()
case
sig
:=
<-
signalChan
:
case
sig
:=
<-
signalChan
:
server
.
Shutdown
(
fmt
.
Sprintf
(
"System signal: %s"
,
sig
))
server
.
Shutdown
(
fmt
.
Sprintf
(
"System signal: %s"
,
sig
))
...
...
pkg/components/imguploader/azureblobuploader.go
View file @
8e9c0a44
...
@@ -127,8 +127,6 @@ type xmlError struct {
...
@@ -127,8 +127,6 @@ type xmlError struct {
const
ms_date_layout
=
"Mon, 02 Jan 2006 15:04:05 GMT"
const
ms_date_layout
=
"Mon, 02 Jan 2006 15:04:05 GMT"
const
version
=
"2017-04-17"
const
version
=
"2017-04-17"
var
client
=
&
http
.
Client
{}
type
StorageClient
struct
{
type
StorageClient
struct
{
Auth
*
Auth
Auth
*
Auth
Transport
http
.
RoundTripper
Transport
http
.
RoundTripper
...
...
pkg/middleware/middleware_test.go
View file @
8e9c0a44
...
@@ -435,11 +435,6 @@ func (sc *scenarioContext) withValidApiKey() *scenarioContext {
...
@@ -435,11 +435,6 @@ func (sc *scenarioContext) withValidApiKey() *scenarioContext {
return
sc
return
sc
}
}
func
(
sc
*
scenarioContext
)
withInvalidApiKey
()
*
scenarioContext
{
sc
.
apiKey
=
"nvalidhhhhds"
return
sc
}
func
(
sc
*
scenarioContext
)
withAuthorizationHeader
(
authHeader
string
)
*
scenarioContext
{
func
(
sc
*
scenarioContext
)
withAuthorizationHeader
(
authHeader
string
)
*
scenarioContext
{
sc
.
authHeader
=
authHeader
sc
.
authHeader
=
authHeader
return
sc
return
sc
...
...
pkg/services/alerting/ticker.go
View file @
8e9c0a44
...
@@ -37,10 +37,6 @@ func NewTicker(last time.Time, initialOffset time.Duration, c clock.Clock) *Tick
...
@@ -37,10 +37,6 @@ func NewTicker(last time.Time, initialOffset time.Duration, c clock.Clock) *Tick
return
t
return
t
}
}
func
(
t
*
Ticker
)
updateOffset
(
offset
time
.
Duration
)
{
t
.
newOffset
<-
offset
}
func
(
t
*
Ticker
)
run
()
{
func
(
t
*
Ticker
)
run
()
{
for
{
for
{
next
:=
t
.
last
.
Add
(
time
.
Duration
(
1
)
*
time
.
Second
)
next
:=
t
.
last
.
Add
(
time
.
Duration
(
1
)
*
time
.
Second
)
...
...
pkg/services/notifications/notifications_test.go
View file @
8e9c0a44
...
@@ -9,12 +9,6 @@ import (
...
@@ -9,12 +9,6 @@ import (
.
"github.com/smartystreets/goconvey/convey"
.
"github.com/smartystreets/goconvey/convey"
)
)
type
testTriggeredAlert
struct
{
ActualValue
float64
Name
string
State
string
}
func
TestNotifications
(
t
*
testing
.
T
)
{
func
TestNotifications
(
t
*
testing
.
T
)
{
Convey
(
"Given the notifications service"
,
t
,
func
()
{
Convey
(
"Given the notifications service"
,
t
,
func
()
{
...
...
pkg/services/sqlstore/dashboard_service_integration_test.go
View file @
8e9c0a44
...
@@ -932,29 +932,6 @@ func TestIntegratedDashboardService(t *testing.T) {
...
@@ -932,29 +932,6 @@ func TestIntegratedDashboardService(t *testing.T) {
})
})
}
}
type
scenarioContext
struct
{
dashboardGuardianMock
*
guardian
.
FakeDashboardGuardian
}
type
scenarioFunc
func
(
c
*
scenarioContext
)
func
dashboardGuardianScenario
(
desc
string
,
mock
*
guardian
.
FakeDashboardGuardian
,
fn
scenarioFunc
)
{
Convey
(
desc
,
func
()
{
origNewDashboardGuardian
:=
guardian
.
New
guardian
.
MockDashboardGuardian
(
mock
)
sc
:=
&
scenarioContext
{
dashboardGuardianMock
:
mock
,
}
defer
func
()
{
guardian
.
New
=
origNewDashboardGuardian
}()
fn
(
sc
)
})
}
type
dashboardPermissionScenarioContext
struct
{
type
dashboardPermissionScenarioContext
struct
{
dashboardGuardianMock
*
guardian
.
FakeDashboardGuardian
dashboardGuardianMock
*
guardian
.
FakeDashboardGuardian
}
}
...
...
pkg/services/sqlstore/transactions_test.go
View file @
8e9c0a44
...
@@ -10,10 +10,6 @@ import (
...
@@ -10,10 +10,6 @@ import (
.
"github.com/smartystreets/goconvey/convey"
.
"github.com/smartystreets/goconvey/convey"
)
)
type
testQuery
struct
{
result
bool
}
var
ProvokedError
=
errors
.
New
(
"testing error."
)
var
ProvokedError
=
errors
.
New
(
"testing error."
)
func
TestTransaction
(
t
*
testing
.
T
)
{
func
TestTransaction
(
t
*
testing
.
T
)
{
...
...
pkg/tsdb/cloudwatch/credentials.go
View file @
8e9c0a44
...
@@ -42,8 +42,7 @@ func GetCredentials(dsInfo *DatasourceInfo) (*credentials.Credentials, error) {
...
@@ -42,8 +42,7 @@ func GetCredentials(dsInfo *DatasourceInfo) (*credentials.Credentials, error) {
accessKeyId
:=
""
accessKeyId
:=
""
secretAccessKey
:=
""
secretAccessKey
:=
""
sessionToken
:=
""
sessionToken
:=
""
var
expiration
*
time
.
Time
var
expiration
*
time
.
Time
=
nil
expiration
=
nil
if
dsInfo
.
AuthType
==
"arn"
&&
strings
.
Index
(
dsInfo
.
AssumeRoleArn
,
"arn:aws:iam:"
)
==
0
{
if
dsInfo
.
AuthType
==
"arn"
&&
strings
.
Index
(
dsInfo
.
AssumeRoleArn
,
"arn:aws:iam:"
)
==
0
{
params
:=
&
sts
.
AssumeRoleInput
{
params
:=
&
sts
.
AssumeRoleInput
{
RoleArn
:
aws
.
String
(
dsInfo
.
AssumeRoleArn
),
RoleArn
:
aws
.
String
(
dsInfo
.
AssumeRoleArn
),
...
...
pkg/tsdb/stackdriver/stackdriver_test.go
View file @
8e9c0a44
...
@@ -353,8 +353,5 @@ func loadTestFile(path string) (StackdriverResponse, error) {
...
@@ -353,8 +353,5 @@ func loadTestFile(path string) (StackdriverResponse, error) {
return
data
,
err
return
data
,
err
}
}
err
=
json
.
Unmarshal
(
jsonBody
,
&
data
)
err
=
json
.
Unmarshal
(
jsonBody
,
&
data
)
if
err
!=
nil
{
return
data
,
err
return
data
,
err
}
return
data
,
nil
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment