Apply gometalinter suggestions
This commit is contained in:
parent
9533aa45cc
commit
9bf553559c
8 changed files with 19 additions and 32 deletions
|
|
@ -73,7 +73,6 @@ const (
|
|||
|
||||
var (
|
||||
tmplPath = "/etc/nginx/template/nginx.tmpl"
|
||||
geoipPath = "/etc/nginx/geoip"
|
||||
cfgPath = "/etc/nginx/nginx.conf"
|
||||
nginxBinary = "/usr/sbin/nginx"
|
||||
)
|
||||
|
|
@ -158,8 +157,7 @@ func NewNGINXController(config *Configuration, fs file.Filesystem) *NGINXControl
|
|||
glog.Warning("Update of ingress status is disabled (flag --update-status=false was specified)")
|
||||
}
|
||||
|
||||
var onTemplateChange func()
|
||||
onTemplateChange = func() {
|
||||
onTemplateChange := func() {
|
||||
template, err := ngx_template.NewTemplate(tmplPath, fs)
|
||||
if err != nil {
|
||||
// this error is different from the rest because it must be clear why nginx is not working
|
||||
|
|
|
|||
|
|
@ -530,39 +530,39 @@ func TestBuildDenyVariable(t *testing.T) {
|
|||
|
||||
func TestBuildClientBodyBufferSize(t *testing.T) {
|
||||
a := isValidClientBodyBufferSize("1000")
|
||||
if a != true {
|
||||
if !a {
|
||||
t.Errorf("Expected '%v' but returned '%v'", true, a)
|
||||
}
|
||||
b := isValidClientBodyBufferSize("1000k")
|
||||
if b != true {
|
||||
if !b {
|
||||
t.Errorf("Expected '%v' but returned '%v'", true, b)
|
||||
}
|
||||
c := isValidClientBodyBufferSize("1000m")
|
||||
if c != true {
|
||||
if !c {
|
||||
t.Errorf("Expected '%v' but returned '%v'", true, c)
|
||||
}
|
||||
d := isValidClientBodyBufferSize("1000km")
|
||||
if d != false {
|
||||
if d {
|
||||
t.Errorf("Expected '%v' but returned '%v'", false, d)
|
||||
}
|
||||
e := isValidClientBodyBufferSize("1000mk")
|
||||
if e != false {
|
||||
if e {
|
||||
t.Errorf("Expected '%v' but returned '%v'", false, e)
|
||||
}
|
||||
f := isValidClientBodyBufferSize("1000kk")
|
||||
if f != false {
|
||||
if f {
|
||||
t.Errorf("Expected '%v' but returned '%v'", false, f)
|
||||
}
|
||||
g := isValidClientBodyBufferSize("1000mm")
|
||||
if g != false {
|
||||
if g {
|
||||
t.Errorf("Expected '%v' but returned '%v'", false, g)
|
||||
}
|
||||
h := isValidClientBodyBufferSize(nil)
|
||||
if h != false {
|
||||
if h {
|
||||
t.Errorf("Expected '%v' but returned '%v'", false, h)
|
||||
}
|
||||
i := isValidClientBodyBufferSize("")
|
||||
if i != false {
|
||||
if i {
|
||||
t.Errorf("Expected '%v' but returned '%v'", false, i)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,12 +20,6 @@ import (
|
|||
"testing"
|
||||
)
|
||||
|
||||
type fakeError struct{}
|
||||
|
||||
func (fe *fakeError) Error() string {
|
||||
return "fakeError"
|
||||
}
|
||||
|
||||
func TestSysctlFSFileMax(t *testing.T) {
|
||||
i := sysctlFSFileMax()
|
||||
if i < 1 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue