Skip to content

Commit

Permalink
Static-check fixes from @lespea #1657, batch 7/n
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Oct 27, 2024
1 parent 047cb4b commit 1a171cf
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
15 changes: 9 additions & 6 deletions cmd/experiments/colors/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions pkg/bifs/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/dsl/cst/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 0 additions & 1 deletion pkg/dsl/cst/statements.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 1 addition & 3 deletions pkg/entrypoint/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
4 changes: 1 addition & 3 deletions pkg/input/record_reader_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1a171cf

Please sign in to comment.