Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading