1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Revert "Make staticcheck more strict and fix new warnings"

This reverts commit 5c456e2513.
This commit is contained in:
Tom Limoncelli
2022-02-11 11:14:46 -05:00
parent a70354775e
commit f9c4887d95
16 changed files with 107 additions and 115 deletions

View File

@ -149,7 +149,7 @@ func require(call otto.FunctionCall) otto.Value {
throw(call.Otto, err.Error())
}
var value = otto.TrueValue()
var value otto.Value = otto.TrueValue()
// If its a json file return the json value, else default to true
if strings.HasSuffix(filepath.Ext(relFile), "json") {
@ -194,7 +194,7 @@ func listFiles(call otto.FunctionCall) otto.Value {
}
// Second: Recursive?
var recursive = true
var recursive bool = true
if call.Argument(1).IsDefined() && !call.Argument(1).IsNull() {
if call.Argument(1).IsBoolean() {
recursive, _ = call.Argument(1).ToBoolean() // If it should be recursive
@ -204,7 +204,7 @@ func listFiles(call otto.FunctionCall) otto.Value {
}
// Third: File extension filter.
var fileExtension = ".js"
var fileExtension string = ".js"
if call.Argument(2).IsDefined() && !call.Argument(2).IsNull() {
if call.Argument(2).IsString() {
fileExtension = call.Argument(2).String() // Which file extension to filter for.