Static-check fixes from @lespea #1657, batch 7/n (#1709)

This commit is contained in:
John Kerl 2024-10-27 12:11:28 -04:00 committed by GitHub
parent b4ff26a7d0
commit 41649bf4f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 14 additions and 14 deletions

View file

@ -6,12 +6,15 @@ import (
"github.com/johnkerl/miller/v6/pkg/colorizer"
)
const boldString = "\u001b[1m"
const underlineString = "\u001b[4m"
const reversedString = "\u001b[7m"
const redString = "\u001b[1;31m"
const blueString = "\u001b[1;34m"
const defaultString = "\u001b[0m"
const (
boldString = "\u001b[1m"
reversedString = "\u001b[7m"
redString = "\u001b[1;31m"
blueString = "\u001b[1;34m"
defaultString = "\u001b[0m"
// underlineString = "\u001b[4m"
)
func main() {
fmt.Printf("Hello, world!\n")

View file

@ -104,6 +104,8 @@ func _zero1(input1 *mlrval.Mlrval) *mlrval.Mlrval {
}
// Return one (unary)
//
//lint:ignore U1000 util function might be used later
func __one1(input1 *mlrval.Mlrval) *mlrval.Mlrval {
return mlrval.FromInt(1)
}

View file

@ -199,7 +199,7 @@ func (node *DumpStatementNode) dumpToStderr(
outputString string,
state *runtime.State,
) error {
fmt.Fprintf(os.Stderr, outputString)
fmt.Fprint(os.Stderr, outputString)
return nil
}

View file

@ -104,7 +104,6 @@ func (root *RootNode) BuildStatementNode(
default:
return nil, fmt.Errorf("at CST BuildStatementNode: unhandled AST node %s", string(astNode.Type))
break
}
return statement, nil
}

View file

@ -104,9 +104,7 @@ func processInPlace(
// Save off the file names from the command line.
fileNames := make([]string, len(originalOptions.FileNames))
for i, fileName := range originalOptions.FileNames {
fileNames[i] = fileName
}
copy(fileNames, originalOptions.FileNames)
for _, fileName := range fileNames {

View file

@ -281,9 +281,7 @@ func (bsr *JSONCommentEnabledReader) Read(p []byte) (n int, err error) {
func (bsr *JSONCommentEnabledReader) populateFromLine(p []byte) int {
numBytesWritten := 0
if len(bsr.lineBytes) < len(p) {
for i := 0; i < len(bsr.lineBytes); i++ {
p[i] = bsr.lineBytes[i]
}
copy(p, bsr.lineBytes)
numBytesWritten = len(bsr.lineBytes)
bsr.lineBytes = nil
} else {