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
ab4e1526
Commit
ab4e1526
authored
Jun 12, 2019
by
Mario Trangoni
Committed by
Carl Bergquist
Jun 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Codestyle: Fix some goconst issues (#17530)
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
parent
39e23ba6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
pkg/api/http_server.go
+1
-1
pkg/api/playlist.go
+3
-1
pkg/setting/setting_test.go
+10
-5
No files found.
pkg/api/http_server.go
View file @
ab4e1526
...
...
@@ -258,7 +258,7 @@ func (hs *HTTPServer) metricsEndpoint(ctx *macaron.Context) {
return
}
if
ctx
.
Req
.
Method
!=
"GET"
||
ctx
.
Req
.
URL
.
Path
!=
"/metrics"
{
if
ctx
.
Req
.
Method
!=
http
.
MethodGet
||
ctx
.
Req
.
URL
.
Path
!=
"/metrics"
{
return
}
...
...
pkg/api/playlist.go
View file @
ab4e1526
package
api
import
(
"net/http"
"github.com/grafana/grafana/pkg/bus"
_
"github.com/grafana/grafana/pkg/infra/log"
m
"github.com/grafana/grafana/pkg/models"
...
...
@@ -33,7 +35,7 @@ func ValidateOrgPlaylist(c *m.ReqContext) {
return
}
if
len
(
items
)
==
0
&&
c
.
Context
.
Req
.
Method
!=
"DELETE"
{
if
len
(
items
)
==
0
&&
c
.
Context
.
Req
.
Method
!=
http
.
MethodDelete
{
c
.
JsonApiErr
(
404
,
"Playlist is empty"
,
itemsErr
)
return
}
...
...
pkg/setting/setting_test.go
View file @
ab4e1526
package
setting
import
(
"gopkg.in/ini.v1"
"os"
"path"
"path/filepath"
"runtime"
"testing"
"gopkg.in/ini.v1"
.
"github.com/smartystreets/goconvey/convey"
)
const
(
windows
=
"windows"
)
func
TestLoadingSettings
(
t
*
testing
.
T
)
{
Convey
(
"Testing loading settings from ini file"
,
t
,
func
()
{
...
...
@@ -72,7 +77,7 @@ func TestLoadingSettings(t *testing.T) {
})
Convey
(
"Should be able to override via command line"
,
func
()
{
if
runtime
.
GOOS
==
"windows"
{
if
runtime
.
GOOS
==
windows
{
cfg
:=
NewCfg
()
cfg
.
Load
(
&
CommandLineArgs
{
HomePath
:
"../../"
,
...
...
@@ -106,7 +111,7 @@ func TestLoadingSettings(t *testing.T) {
})
Convey
(
"Defaults can be overridden in specified config file"
,
func
()
{
if
runtime
.
GOOS
==
"windows"
{
if
runtime
.
GOOS
==
windows
{
cfg
:=
NewCfg
()
cfg
.
Load
(
&
CommandLineArgs
{
HomePath
:
"../../"
,
...
...
@@ -128,7 +133,7 @@ func TestLoadingSettings(t *testing.T) {
})
Convey
(
"Command line overrides specified config file"
,
func
()
{
if
runtime
.
GOOS
==
"windows"
{
if
runtime
.
GOOS
==
windows
{
cfg
:=
NewCfg
()
cfg
.
Load
(
&
CommandLineArgs
{
HomePath
:
"../../"
,
...
...
@@ -150,7 +155,7 @@ func TestLoadingSettings(t *testing.T) {
})
Convey
(
"Can use environment variables in config values"
,
func
()
{
if
runtime
.
GOOS
==
"windows"
{
if
runtime
.
GOOS
==
windows
{
os
.
Setenv
(
"GF_DATA_PATH"
,
`c:\tmp\env_override`
)
cfg
:=
NewCfg
()
cfg
.
Load
(
&
CommandLineArgs
{
...
...
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