Skip to content

chore: golangci-lint run --fix ./...#7018

Merged
dogancanbakir merged 2 commits intodevfrom
dwisiswant0/chore/go-fix
Mar 4, 2026
Merged

chore: golangci-lint run --fix ./...#7018
dogancanbakir merged 2 commits intodevfrom
dwisiswant0/chore/go-fix

Conversation

@dwisiswant0
Copy link
Member

@dwisiswant0 dwisiswant0 commented Feb 24, 2026

Proposed changes

Run golangci-lint run --fix ./... (from go1.26.0)

Proof

This is verifiable through GolangCI Lint action.

As of projectdiscovery/actions/golangci-lint/v2 uses golangci/golangci-lint-action@v8 and it uses golangci-lint >= v2.9.0 (analyzer bump), hence the adjustment is requried.

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Summary by CodeRabbit

  • Refactor
    • Streamlined string formatting across multiple modules for small performance and allocation improvements; no change to outputs or behavior.
  • Bug Fixes / Tests
    • Improved page-title retrieval in tests for more robust validation.
  • Chore
    • Modified browser lifecycle handling: the system no longer tracks previously running browser processes, which may affect process cleanup behavior.

Relates to #7047

@auto-assign auto-assign bot requested a review from Mzack9999 February 24, 2026 17:57
@neo-by-projectdiscovery-dev
Copy link

neo-by-projectdiscovery-dev bot commented Feb 24, 2026

Neo - PR Security Review

No security issues found

Highlights

  • Automated code formatting and linting fixes applied via golangci-lint
  • Changes limited to headless browser engine initialization and test code
  • No user-facing functionality or security-sensitive code paths modified

Comment @neo help for available commands. · Open in Neo

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c27c474 and 1556d08.

📒 Files selected for processing (2)
  • pkg/protocols/headless/engine/engine.go
  • pkg/protocols/headless/engine/page_actions_test.go
💤 Files with no reviewable changes (1)
  • pkg/protocols/headless/engine/engine.go

Walkthrough

Replaces numerous fmt.Sprintf + WriteString patterns with direct fmt.Fprintf into builders across multiple packages; additionally removes Browser.previousPIDs and related process cleanup logic, and tightens a test to use page.Page().Info() with error handling instead of MustInfo().

Changes

Cohort / File(s) Summary
Bulk formatting updates
pkg/js/libs/ldap/utils.go, pkg/utils/utils.go, internal/runner/healthcheck.go, lib/sdk_private.go, pkg/fuzz/analyzers/time/time_delay.go, pkg/js/devtools/scrapefuncs/main.go, pkg/js/devtools/tsgen/cmd/tsgen/main.go, pkg/js/libs/mysql/mysql_private.go, pkg/protocols/headless/engine/rules.go, pkg/reporting/reporting.go
Replaced fmt.Sprintf + WriteString (or WriteString(fmt.Sprintf(...))) with direct fmt.Fprintf calls into strings.Builder/buffers throughout these files; behavior and outputs remain unchanged.
Headless engine lifecycle change
pkg/protocols/headless/engine/engine.go
Removed exported/internal field Browser.previousPIDs and deleted code that populated/used it (processutil import and previous-process cleanup).
Test robustness update
pkg/protocols/headless/engine/page_actions_test.go
Replaced MustInfo().Title usage with a nil check and page.Page().Info() call, handling the error before asserting Info().Title.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through code, nibbling Sprintf crumbs,

swapped them for Fprintf—no middle-strings bums.
I left processes fewer, made tests more precise,
A tidy, lean change—delicious and nice! 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'chore: golangci-lint run --fix ./...' is only partially related to the changeset—it describes the command that generated some changes, but the actual changeset includes a significant functional fix (removing previousPIDs from Browser struct to prevent cross-test Chrome teardown races) alongside lint-related formatting optimizations. Revise the title to reflect the main functional change: 'fix(headless): avoid cross-test chrome teardown races' or 'chore: golangci-lint fixes and headless engine chrome process cleanup'.
Docstring Coverage ⚠️ Warning Docstring coverage is 34.62% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dwisiswant0/chore/go-fix

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (6)
pkg/tmplexec/flow/vm.go (1)

58-71: ⚠️ Potential issue | 🟡 Minor

Logging stream mismatch (stdout vs stderr).

log is documented as stdout but gologger.DefaultLogger.Print() writes to stderr. For correct piping/redirects, either switch to Silent() or update the description to say stderr.

✅ Suggested fix (stdout)
-				gologger.DefaultLogger.Print().Msgf("[%v] %v", aurora.BrightCyan("JS"), value)
+				gologger.DefaultLogger.Silent().Msgf("[%v] %v", aurora.BrightCyan("JS"), value)

Based on learnings, "In projectdiscovery/gologger, the Print() function writes to stderr and Silent() writes to stdout. During reviews, ensure code uses Print() for error/output going to stderr and Silent() for stdout; verify the chosen function matches the intended destination and that logs are directed to the correct stream for proper piping/redirects."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/tmplexec/flow/vm.go` around lines 58 - 71, The "log" template function
(Name: "log", FuncDecl) claims to write to stdout but currently uses
gologger.DefaultLogger.Print(), which outputs to stderr; update the
implementation to use gologger.DefaultLogger.Silent() for all branches (string,
map[string]any, default) so logs go to stdout, or alternatively change the
Description text to indicate stderr if you intend to keep Print(); ensure every
call site inside the FuncDecl is changed consistently (replace Print() calls)
and keep the aurora and vardump usage the same.
pkg/utils/insertion_ordered_map.go (1)

36-59: ⚠️ Potential issue | 🟡 Minor

Reset keys when unmarshalling to avoid stale ordering.
values is reinitialized but keys is not, so reusing the same instance can append new keys after old ones and produce duplicates.

🛠️ Suggested fix
 func (insertionOrderedStringMap *InsertionOrderedStringMap) UnmarshalYAML(unmarshal func(any) error) error {
 	var data yaml.MapSlice
 	if err := unmarshal(&data); err != nil {
 		return err
 	}
 	insertionOrderedStringMap.values = make(map[string]any)
+	insertionOrderedStringMap.keys = make([]string, 0, len(data))
 	for _, v := range data {
 		if v.Key == nil {
 			continue
 		}
 		insertionOrderedStringMap.Set(v.Key.(string), toString(v.Value))
 	}
 	return nil
 }

 func (insertionOrderedStringMap *InsertionOrderedStringMap) UnmarshalJSON(data []byte) error {
 	var dataMap map[string]any
 	if err := json.Unmarshal(data, &dataMap); err != nil {
 		return err
 	}
 	insertionOrderedStringMap.values = make(map[string]any)
+	insertionOrderedStringMap.keys = make([]string, 0, len(dataMap))
 	for k, v := range dataMap {
 		insertionOrderedStringMap.Set(k, toString(v))
 	}
 	return nil
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/utils/insertion_ordered_map.go` around lines 36 - 59, UnmarshalYAML and
UnmarshalJSON reinitialize insertionOrderedStringMap.values but don't reset the
keys slice, causing old keys to persist and produce duplicates; update both
methods (UnmarshalYAML and UnmarshalJSON on InsertionOrderedStringMap) to reset
insertionOrderedStringMap.keys (e.g., assign nil or make([]string,0)) before
calling Set so the ordering is rebuilt from the unmarshalled data.
pkg/js/libs/rsync/memo.rsync.go (1)

1-1: ⚠️ Potential issue | 🟠 Major

Update the memogen template to use any instead of interface{}.

The memo.*.go files were updated via go fix ./... to use any instead of interface{}, but the generator template (cmd/memogen/function.tpl line 16) still emits interface{}. The next invocation of make memogen will silently revert this change.

Update cmd/memogen/function.tpl line 16 from:

v, err, _ := protocolstate.Memoizer.Do(hash, func() (interface{}, error) {

to:

v, err, _ := protocolstate.Memoizer.Do(hash, func() (any, error) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/js/libs/rsync/memo.rsync.go` at line 1, The memogen generator template
still emits interface{} for the Memoizer.Do callback return type; update the
template (cmd/memogen/function.tpl) so the generated line uses (any, error)
instead of (interface{}, error): change the anonymous function signature in the
emitted code where you produce "v, err, _ := protocolstate.Memoizer.Do(hash,
func() (... ) {" to return (any, error), ensuring generated files no longer
revert to interface{} for the Memoizer.Do callback.
pkg/js/devtools/tsgen/scrape.go (1)

49-55: ⚠️ Potential issue | 🟡 Minor

Remove redundant variable shadows in range-over-func loops.

The field := field assignments on lines 50 and 121 are unnecessary. Since Go 1.22, loop variables in range statements are uniquely scoped per iteration, making these self-assignments dead code. The same redundant pattern appears in pkg/js/devtools/bindgen/generator.go:400.

Suggested cleanup
-	for field := range namedStruct.Fields() {
-		field := field
+	for field := range namedStruct.Fields() {
 		fieldName := field.Name()
-		for field := range t.Fields() {
-			field := field
+		for field := range t.Fields() {
 			if field.Exported() {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/js/devtools/tsgen/scrape.go` around lines 49 - 55, Remove the redundant
self-assignments that shadow the loop variable in the range loops: delete the
unnecessary "field := field" inside the loop iterating namedStruct.Fields() in
pkg/js/devtools/tsgen/scrape.go (the loop that calls recursiveScrapeType(nil,
fieldName, field.Type(), d)) and the similar redundant "field := field" at the
other occurrence in pkg/js/devtools/bindgen/generator.go around line 400; rely
on Go's per-iteration scoped loop variable and keep using field.Name(),
field.Exported(), and field.Type() directly.
pkg/reporting/trackers/jira/jira.go (1)

282-309: ⚠️ Potential issue | 🔴 Critical

Type assertion for map[any]any will silently skip custom fields loaded from JSON/YAML.

When configurations are unmarshalled from JSON or YAML, Go produces map[string]interface{} (equivalent to map[string]any), not map[any]any. The code at line 285 asserts value.(map[any]any), which fails for JSON-sourced configs because map[string]any cannot be asserted to map[any]any in Go's type system. Custom fields from JSON/YAML will silently be skipped with no warning beyond the existing log message for nested value errors.

Normalize both map types before iteration:

🔧 Suggested fix
-	for name, value := range i.options.CustomFields {
-		if valueMap, ok := value.(map[any]any); ok {
-			// Iterate over nested map
-			for nestedName, nestedValue := range valueMap {
+	for name, value := range i.options.CustomFields {
+		var valueMap map[string]any
+		switch v := value.(type) {
+		case map[string]any:
+			valueMap = v
+		case map[any]any:
+			valueMap = make(map[string]any, len(v))
+			for k, nv := range v {
+				ks, ok := k.(string)
+				if !ok {
+					return nil, fmt.Errorf(`custom field %q has non-string key: %v`, name, k)
+				}
+				valueMap[ks] = nv
+			}
+		default:
+			continue
+		}
+
+		// Iterate over nested map
+		for nestedName, nestedValue := range valueMap {
 				fmtNestedValue, ok := nestedValue.(string)
 				if !ok {
 					return nil, fmt.Errorf(`couldn't iterate on nested item "%s": %s`, nestedName, nestedValue)
 				}
@@
-			}
-		}
+		}
 	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/reporting/trackers/jira/jira.go` around lines 282 - 309, The loop that
processes i.options.CustomFields currently asserts value.(map[any]any) which
will fail for typical JSON/YAML unmarshalling (map[string]any); update the
handling in the block that builds customFields so it accepts both map[string]any
and map[any]any (or normalizes the map) before iterating: detect the concrete
type, convert keys to string as needed, then iterate nestedName/nestedValue and
call i.evaluateCustomFieldValue as before, preserving the existing switch cases
for "id"/"name"/"freeform" and fallback behavior; reference the same variables
and functions (i.options.CustomFields, customFields, nestedName, nestedValue,
i.evaluateCustomFieldValue) so the change is localized and avoids silently
skipping JSON/YAML-provided custom fields.
pkg/protocols/common/generators/options.go (1)

12-12: ⚠️ Potential issue | 🟡 Minor

Stale comment — update map[string]interface{} to map[string]any.

The sync.Map annotation on Line 12 still references the old type spelling after the migration.

📝 Proposed fix
-var optionsPayloadMap sync.Map // map[*types.Options]map[string]interface{}
+var optionsPayloadMap sync.Map // map[*types.Options]map[string]any
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/protocols/common/generators/options.go` at line 12, Update the stale type
spelling in the inline comment for the sync.Map variable: change the comment on
optionsPayloadMap (currently "// map[*types.Options]map[string]interface{}") to
use the new alias "// map[*types.Options]map[string]any" so the annotation
matches the migrated type naming; locate the variable optionsPayloadMap declared
with sync.Map and replace only the comment text accordingly.
♻️ Duplicate comments (9)
pkg/protocols/headless/operators_test.go (7)

173-175: Duplicate of earlier type modernization. Same rationale as Line 34–36.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/protocols/headless/operators_test.go` around lines 173 - 175, Duplicate
modernization: the test assigns data = map[string]any{"data": invalidJSON} but
this should match the earlier type used at lines 34–36; update the assignment
for the variable data to use the same type as the earlier declaration (e.g.,
map[string]interface{} if that is used previously) so the test is consistent
with the existing type usage for variable names data and invalidJSON in
operators_test.go.

482-484: Duplicate of earlier type modernization. Same rationale as Line 34–36.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/protocols/headless/operators_test.go` around lines 482 - 484, This is a
duplicate modernization: the local variable data := map[string]any{"data":
htmlContent} repeats the same type change already applied earlier; remove this
redundant declaration and reuse the previously declared variable or the earlier
typed pattern, or revert this duplicate to match the original type usage so
there's only one consistent modernization for the variable named data (refer to
the data variable and htmlContent in operators_test.go to locate the duplicated
change).

216-218: Duplicate of earlier type modernization. Same rationale as Line 34–36.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/protocols/headless/operators_test.go` around lines 216 - 218, The map
modernization for the local variable "data" is a duplicate of an earlier change;
revert or remove this duplicate by restoring the original type usage where
"data" is defined (either remove this second declaration and reuse the earlier
"data" variable or change it back from map[string]any to the original map type
used elsewhere, referencing the "data" variable and "htmlContent" to locate the
code). Ensure only the single intended modernization remains to avoid redundant
edits.

294-298: Duplicate of earlier type modernization. Same rationale as Line 34–36.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/protocols/headless/operators_test.go` around lines 294 - 298, The map
literal for variable data uses map[string]any which is a duplicate of an earlier
modernization change; update this declaration to use the same map type used at
the earlier occurrence (lines 34–36) for consistency—i.e., change the type of
data from map[string]any to the identical type alias used previously in this
file (matching the other declarations that reference htmlContent and
jsonContent).

368-370: Duplicate of earlier type modernization. Same rationale as Line 34–36.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/protocols/headless/operators_test.go` around lines 368 - 370, The test
uses a duplicate type modernization for the local variable "data"; replace the
current map[string]any literal with the same type used earlier in this file (use
map[string]interface{} for the "data" variable constructed from "jsonContent")
so the test's type style is consistent with the earlier declaration around lines
34–36; update the "data" assignment accordingly.

250-254: Duplicate of earlier type modernization. Same rationale as Line 34–36.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/protocols/headless/operators_test.go` around lines 250 - 254, The map
literal creating variable "data" is a duplicate of the earlier
type-modernization; remove this redundant declaration and either reuse the
previously declared "data" variable or rename/merge this usage so you don't
shadow or redefine it. Locate the "data" map literal in operators_test.go and
align it with the earlier modernization pattern (use the same map type and
single declaration) to eliminate the duplicate.

107-109: Duplicate of earlier type modernization. Same rationale as Line 34–36.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/protocols/headless/operators_test.go` around lines 107 - 109, The test
declares data with map[string]any which duplicates a previous
type-modernization; make this declaration consistent with the earlier change
(lines 34–36) by using the same type as used there—e.g., change the data :=
map[string]any{ "data": jsonContent } to use map[string]interface{} (or to
map[string]any if the earlier lines use any) so the variable name data and its
use of jsonContent match the project's chosen type convention.
pkg/workflows/workflows.go (1)

55-55: Same JSON compatibility concern for Name.

This is the same omitempty removal issue as Tags—please confirm the behavior change is intended or revert to keep compatibility.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/workflows/workflows.go` at line 55, The struct field Name (type
stringslice.StringSlice) lost the `omitempty` JSON tag which changes
serialization behavior and can break compatibility; either restore the original
`json:"name,omitempty"` tag on the Name field in workflows.go to preserve
previous behavior or explicitly document and update callers/tests if the intent
is to remove `omitempty`. Locate the Name field declaration (Name
stringslice.StringSlice) and revert/add the `omitempty` in the json struct tag
to match how Tags was handled or confirm the intentional change and update
changelog/tests accordingly.
pkg/js/devtools/tsgen/scrape.go (1)

120-125: Same pattern as Lines 49–55.

Both the Fields() call-style concern and the redundant field := field shadow on Line 121 are identical to the issues raised above for Lines 49–55; the proposed fix diff above already covers this site.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/js/devtools/tsgen/scrape.go` around lines 120 - 125, The loop over
t.Fields() is using "for field := range t.Fields()" which iterates indices (and
then shadows the variable with "field := field"); change it to iterate values
with "for _, field := range t.Fields()" and remove the redundant shadowing so
calls to field.Name() and field.Type() in recursiveScrapeType(nil, field.Name(),
field.Type(), nestedExtObject) use the actual field value; keep the Exported()
check as-is.
🧹 Nitpick comments (6)
pkg/protocols/http/signer/signer.go (1)

51-51: Nit: remove stale comment.

// type ctxkey string is a leftover from a previous refactor and is never used. Consider removing it to keep the file tidy.

🧹 Proposed cleanup
-	// type ctxkey string
 	ctx := context.WithValue(context.Background(), SignerArg("service"), service)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/protocols/http/signer/signer.go` at line 51, Remove the stale commented
declaration "// type ctxkey string" from signer.go; locate the commented line
(the unused ctxkey identifier) near the top of the file and delete it so the
file no longer contains this leftover comment from the previous refactor.
pkg/reporting/trackers/linear/jsonutil/jsonutil.go (1)

200-203: Nit: commented-out code still references deprecated reflect.Ptr.

go fix doesn't rewrite comments, so this TODO block was left with the old name. If the comment is ever uncommented, it would need updating too.

🧹 Proposed cleanup
-			//if v.Kind() == reflect.Ptr && v.IsNil() {
+			//if v.Kind() == reflect.Pointer && v.IsNil() {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/reporting/trackers/linear/jsonutil/jsonutil.go` around lines 200 - 203,
The commented TODO block inside jsonutil.go still uses the deprecated
reflect.Ptr identifier (in the lines referencing v.Kind() == reflect.Ptr and
reflect.New), so update or remove the comment to avoid misleading future
uncommenting: either change reflect.Ptr to the current name reflect.Pointer in
the comment and any example code (references: v.Kind(), v.IsNil(),
v.Set(reflect.New(v.Type().Elem()))), or delete the commented block entirely if
it’s stale; if you keep it, also update the TODO to state the exact behavior to
test (initializing nil pointers via reflect.Pointer/new) so it won’t reintroduce
the deprecated symbol.
pkg/protocols/common/helpers/responsehighlighter/hexdump.go (1)

35-40: Avoid temporary concatenation inside the Builder.

WriteString currently receives a pre-concatenated string, which still allocates per-iteration. You can eliminate that intermediate allocation by writing each part directly.

♻️ Proposed refactor
for i := 0; i < hexDump.len(); i++ {
-	result.WriteString(hexDump.index[i] + hexDump.hex[i] + "|" + hexDump.ascii[i] + "|\n")
+	result.WriteString(hexDump.index[i])
+	result.WriteString(hexDump.hex[i])
+	result.WriteString("|")
+	result.WriteString(hexDump.ascii[i])
+	result.WriteString("|\n")
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/protocols/common/helpers/responsehighlighter/hexdump.go` around lines 35
- 40, The String method of HighlightableHexDump currently concatenates
per-iteration with "+", causing temporary allocations; change the loop in
HighlightableHexDump.String() to write each piece directly into the
strings.Builder (e.g., call result.WriteString(hexDump.index[i]),
result.WriteString(hexDump.hex[i]), result.WriteByte('|'),
result.WriteString(hexDump.ascii[i]), result.WriteString("|\n") in sequence) and
optionally call result.Grow(...) before the loop to preallocate capacity based
on hexDump.len() to avoid per-iteration allocations.
internal/runner/runner.go (1)

987-987: Stale interface{} reference in doc comment.

The function parameter type was updated to any, but the doc comment on line 987 still references interface{}.

♻️ Proposed fix
-// The interface{} passed to the function should be a pointer to a struct or a struct.
+// The any value passed to the function should be a pointer to a struct or a struct.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/runner/runner.go` at line 987, Update the stale doc comment that
still mentions "interface{}" to use "any" to match the changed parameter type;
locate the comment above the function in internal/runner/runner.go (the comment
at line ~987) that explains the parameter must be "a pointer to a struct or a
struct" and replace "interface{}" with "any" while preserving the rest of the
description so it accurately documents the function signature that now accepts
any.
pkg/js/compiler/pool.go (1)

232-232: LGTM on the reflect.Ptrreflect.Pointer update.

reflect.Pointer is the preferred name since Go 1.18 and has the same underlying value as reflect.Ptr.

As a side note (pre-existing, not introduced by this PR), the condition on line 232 relies on && binding tighter than || for correct behavior. While this works as intended, adding explicit parentheses would improve readability:

🔧 Optional: clarify precedence with explicit parentheses
-	if kind == reflect.Struct || kind == reflect.Pointer && reflect.ValueOf(value).Elem().Kind() == reflect.Struct {
+	if kind == reflect.Struct || (kind == reflect.Pointer && reflect.ValueOf(value).Elem().Kind() == reflect.Struct) {

Also applies to: 247-248

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/js/compiler/pool.go` at line 232, The boolean expression using
reflect.Kind checks (e.g., the condition "if kind == reflect.Struct || kind ==
reflect.Pointer && reflect.ValueOf(value).Elem().Kind() == reflect.Struct")
relies on && binding tighter than ||; make the precedence explicit by adding
parentheses around the pointer case like "(kind == reflect.Pointer && ...)" so
the intention is clear, and apply the same parenthesization to the analogous
conditions around lines 247-248 (search for the similar reflect.Kind checks in
the same function in pkg/js/compiler/pool.go) to improve readability.
pkg/fuzz/dataformat/json.go (1)

14-16: Stale map[string]interface{} reference in the TODO comment.

The struct doc (unchanged by go fix) still reads map[string]interface{}, which is now inconsistent with the map[string]any used throughout this file and the broader codebase.

📝 Suggested comment update
 // TODO: Support arrays + other JSON oddities by
-// adding more attributes to the map[string]interface{}
+// adding more attributes to the map[string]any
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/fuzz/dataformat/json.go` around lines 14 - 16, Update the stale TODO
comment above the JSON struct: change the textual reference from
"map[string]interface{}" to "map[string]any" so the comment matches the types
used in this file and the codebase; locate the comment near the JSON struct
declaration (type JSON struct{}) and edit the comment text only—no code changes
required.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/fuzz/dataformat/dataformat_test.go`:
- Around line 44-46: The test's failure message is stale after the any
migration: update the t.Fatal call in the type assertion block that checks
fooMap, ok := fooValue.(map[string]any) to reference the correct type name
(`map[string]any`) instead of `map[string]interface{}`; locate the assertion
around fooValue and fooMap in the test and change the message string to
something like "type assertion to map[string]any failed" so it matches the
actual asserted type.

In `@pkg/fuzz/dataformat/multipart_test.go`:
- Around line 237-239: The assertion message for the type check uses "Expected
[]interface{} for documents" but the code casts to []any; update the assertion
message in the documents type-check (the require.True call that checks
documents.([]any) and the variable documentsArray) to say "Expected []any for
documents" so the message matches the actual type used.
- Around line 230-232: The test assertion message is inconsistent: it says
"Expected []interface{} for profile_picture" while the code uses profileArray,
profilePicture and type []any; update the require.True call's message to
reference "[]any" (or "[]any for profile_picture") so the diagnostic matches the
actual type check for profileArray/profilePicture in multipart_test.go.

In `@pkg/js/libs/oracle/memo.oracle.go`:
- Line 14: Update the generator template that emits memoized function signatures
so it uses the new Go alias type `any` instead of `interface{}`: locate the
template file named function.tpl and change the anonymous function return type
from `func() (interface{}, error)` to `func() (any, error)` so future runs of
the memogen generator will produce memo.*.go files with `any` and avoid
regressing the recent change.

In `@pkg/model/model.go`:
- Line 35: The JSON struct tags for Authors, Tags, SeverityHolder, CVEID, and
CWEID were modified to remove `omitempty`—restore `omitempty` on the JSON tag
for each of these fields in the model struct (look for the `Authors`, `Tags`,
`SeverityHolder`, `CVEID`, `CWEID` field declarations in pkg/model/model.go) so
empty values are omitted from JSON output; update the tag strings to include
`omitempty` (e.g., `json:"author,omitempty"`) for each named field and run tests
(including TestInfoJsonMarshal) to ensure compatibility.

In `@pkg/protocols/http/http.go`:
- Line 70: The JSON struct tags for the AttackType, Method, and Signature fields
are missing the omitempty option (while their YAML tags include it), causing
inconsistent serialization; update the struct field tags for AttackType
(generators.AttackTypeHolder), Method, and Signature to include `omitempty` in
their `json:"..."` tags so JSON omits empty values just like YAML—locate the
fields by name in the struct and add `omitempty` to each corresponding json tag.

In `@pkg/workflows/workflows.go`:
- Line 33: The Tags struct tag lost `omitempty`, which changes JSON output by
emitting empty values and may break clients; restore `omitempty` in the Tags
field tag (the Tags field on the struct named Tags stringslice.StringSlice)
unless this API change is intentional, or else add versioned documentation to
mark the breaking change; after updating the struct tag, run go fmt ./... and go
vet ./... to ensure formatting and static analysis pass.

---

Outside diff comments:
In `@pkg/js/devtools/tsgen/scrape.go`:
- Around line 49-55: Remove the redundant self-assignments that shadow the loop
variable in the range loops: delete the unnecessary "field := field" inside the
loop iterating namedStruct.Fields() in pkg/js/devtools/tsgen/scrape.go (the loop
that calls recursiveScrapeType(nil, fieldName, field.Type(), d)) and the similar
redundant "field := field" at the other occurrence in
pkg/js/devtools/bindgen/generator.go around line 400; rely on Go's per-iteration
scoped loop variable and keep using field.Name(), field.Exported(), and
field.Type() directly.

In `@pkg/js/libs/rsync/memo.rsync.go`:
- Line 1: The memogen generator template still emits interface{} for the
Memoizer.Do callback return type; update the template (cmd/memogen/function.tpl)
so the generated line uses (any, error) instead of (interface{}, error): change
the anonymous function signature in the emitted code where you produce "v, err,
_ := protocolstate.Memoizer.Do(hash, func() (... ) {" to return (any, error),
ensuring generated files no longer revert to interface{} for the Memoizer.Do
callback.

In `@pkg/protocols/common/generators/options.go`:
- Line 12: Update the stale type spelling in the inline comment for the sync.Map
variable: change the comment on optionsPayloadMap (currently "//
map[*types.Options]map[string]interface{}") to use the new alias "//
map[*types.Options]map[string]any" so the annotation matches the migrated type
naming; locate the variable optionsPayloadMap declared with sync.Map and replace
only the comment text accordingly.

In `@pkg/reporting/trackers/jira/jira.go`:
- Around line 282-309: The loop that processes i.options.CustomFields currently
asserts value.(map[any]any) which will fail for typical JSON/YAML unmarshalling
(map[string]any); update the handling in the block that builds customFields so
it accepts both map[string]any and map[any]any (or normalizes the map) before
iterating: detect the concrete type, convert keys to string as needed, then
iterate nestedName/nestedValue and call i.evaluateCustomFieldValue as before,
preserving the existing switch cases for "id"/"name"/"freeform" and fallback
behavior; reference the same variables and functions (i.options.CustomFields,
customFields, nestedName, nestedValue, i.evaluateCustomFieldValue) so the change
is localized and avoids silently skipping JSON/YAML-provided custom fields.

In `@pkg/tmplexec/flow/vm.go`:
- Around line 58-71: The "log" template function (Name: "log", FuncDecl) claims
to write to stdout but currently uses gologger.DefaultLogger.Print(), which
outputs to stderr; update the implementation to use
gologger.DefaultLogger.Silent() for all branches (string, map[string]any,
default) so logs go to stdout, or alternatively change the Description text to
indicate stderr if you intend to keep Print(); ensure every call site inside the
FuncDecl is changed consistently (replace Print() calls) and keep the aurora and
vardump usage the same.

In `@pkg/utils/insertion_ordered_map.go`:
- Around line 36-59: UnmarshalYAML and UnmarshalJSON reinitialize
insertionOrderedStringMap.values but don't reset the keys slice, causing old
keys to persist and produce duplicates; update both methods (UnmarshalYAML and
UnmarshalJSON on InsertionOrderedStringMap) to reset
insertionOrderedStringMap.keys (e.g., assign nil or make([]string,0)) before
calling Set so the ordering is rebuilt from the unmarshalled data.

---

Duplicate comments:
In `@pkg/js/devtools/tsgen/scrape.go`:
- Around line 120-125: The loop over t.Fields() is using "for field := range
t.Fields()" which iterates indices (and then shadows the variable with "field :=
field"); change it to iterate values with "for _, field := range t.Fields()" and
remove the redundant shadowing so calls to field.Name() and field.Type() in
recursiveScrapeType(nil, field.Name(), field.Type(), nestedExtObject) use the
actual field value; keep the Exported() check as-is.

In `@pkg/protocols/headless/operators_test.go`:
- Around line 173-175: Duplicate modernization: the test assigns data =
map[string]any{"data": invalidJSON} but this should match the earlier type used
at lines 34–36; update the assignment for the variable data to use the same type
as the earlier declaration (e.g., map[string]interface{} if that is used
previously) so the test is consistent with the existing type usage for variable
names data and invalidJSON in operators_test.go.
- Around line 482-484: This is a duplicate modernization: the local variable
data := map[string]any{"data": htmlContent} repeats the same type change already
applied earlier; remove this redundant declaration and reuse the previously
declared variable or the earlier typed pattern, or revert this duplicate to
match the original type usage so there's only one consistent modernization for
the variable named data (refer to the data variable and htmlContent in
operators_test.go to locate the duplicated change).
- Around line 216-218: The map modernization for the local variable "data" is a
duplicate of an earlier change; revert or remove this duplicate by restoring the
original type usage where "data" is defined (either remove this second
declaration and reuse the earlier "data" variable or change it back from
map[string]any to the original map type used elsewhere, referencing the "data"
variable and "htmlContent" to locate the code). Ensure only the single intended
modernization remains to avoid redundant edits.
- Around line 294-298: The map literal for variable data uses map[string]any
which is a duplicate of an earlier modernization change; update this declaration
to use the same map type used at the earlier occurrence (lines 34–36) for
consistency—i.e., change the type of data from map[string]any to the identical
type alias used previously in this file (matching the other declarations that
reference htmlContent and jsonContent).
- Around line 368-370: The test uses a duplicate type modernization for the
local variable "data"; replace the current map[string]any literal with the same
type used earlier in this file (use map[string]interface{} for the "data"
variable constructed from "jsonContent") so the test's type style is consistent
with the earlier declaration around lines 34–36; update the "data" assignment
accordingly.
- Around line 250-254: The map literal creating variable "data" is a duplicate
of the earlier type-modernization; remove this redundant declaration and either
reuse the previously declared "data" variable or rename/merge this usage so you
don't shadow or redefine it. Locate the "data" map literal in operators_test.go
and align it with the earlier modernization pattern (use the same map type and
single declaration) to eliminate the duplicate.
- Around line 107-109: The test declares data with map[string]any which
duplicates a previous type-modernization; make this declaration consistent with
the earlier change (lines 34–36) by using the same type as used there—e.g.,
change the data := map[string]any{ "data": jsonContent } to use
map[string]interface{} (or to map[string]any if the earlier lines use any) so
the variable name data and its use of jsonContent match the project's chosen
type convention.

In `@pkg/workflows/workflows.go`:
- Line 55: The struct field Name (type stringslice.StringSlice) lost the
`omitempty` JSON tag which changes serialization behavior and can break
compatibility; either restore the original `json:"name,omitempty"` tag on the
Name field in workflows.go to preserve previous behavior or explicitly document
and update callers/tests if the intent is to remove `omitempty`. Locate the Name
field declaration (Name stringslice.StringSlice) and revert/add the `omitempty`
in the json struct tag to match how Tags was handled or confirm the intentional
change and update changelog/tests accordingly.

---

Nitpick comments:
In `@internal/runner/runner.go`:
- Line 987: Update the stale doc comment that still mentions "interface{}" to
use "any" to match the changed parameter type; locate the comment above the
function in internal/runner/runner.go (the comment at line ~987) that explains
the parameter must be "a pointer to a struct or a struct" and replace
"interface{}" with "any" while preserving the rest of the description so it
accurately documents the function signature that now accepts any.

In `@pkg/fuzz/dataformat/json.go`:
- Around line 14-16: Update the stale TODO comment above the JSON struct: change
the textual reference from "map[string]interface{}" to "map[string]any" so the
comment matches the types used in this file and the codebase; locate the comment
near the JSON struct declaration (type JSON struct{}) and edit the comment text
only—no code changes required.

In `@pkg/js/compiler/pool.go`:
- Line 232: The boolean expression using reflect.Kind checks (e.g., the
condition "if kind == reflect.Struct || kind == reflect.Pointer &&
reflect.ValueOf(value).Elem().Kind() == reflect.Struct") relies on && binding
tighter than ||; make the precedence explicit by adding parentheses around the
pointer case like "(kind == reflect.Pointer && ...)" so the intention is clear,
and apply the same parenthesization to the analogous conditions around lines
247-248 (search for the similar reflect.Kind checks in the same function in
pkg/js/compiler/pool.go) to improve readability.

In `@pkg/protocols/common/helpers/responsehighlighter/hexdump.go`:
- Around line 35-40: The String method of HighlightableHexDump currently
concatenates per-iteration with "+", causing temporary allocations; change the
loop in HighlightableHexDump.String() to write each piece directly into the
strings.Builder (e.g., call result.WriteString(hexDump.index[i]),
result.WriteString(hexDump.hex[i]), result.WriteByte('|'),
result.WriteString(hexDump.ascii[i]), result.WriteString("|\n") in sequence) and
optionally call result.Grow(...) before the loop to preallocate capacity based
on hexDump.len() to avoid per-iteration allocations.

In `@pkg/protocols/http/signer/signer.go`:
- Line 51: Remove the stale commented declaration "// type ctxkey string" from
signer.go; locate the commented line (the unused ctxkey identifier) near the top
of the file and delete it so the file no longer contains this leftover comment
from the previous refactor.

In `@pkg/reporting/trackers/linear/jsonutil/jsonutil.go`:
- Around line 200-203: The commented TODO block inside jsonutil.go still uses
the deprecated reflect.Ptr identifier (in the lines referencing v.Kind() ==
reflect.Ptr and reflect.New), so update or remove the comment to avoid
misleading future uncommenting: either change reflect.Ptr to the current name
reflect.Pointer in the comment and any example code (references: v.Kind(),
v.IsNil(), v.Set(reflect.New(v.Type().Elem()))), or delete the commented block
entirely if it’s stale; if you keep it, also update the TODO to state the exact
behavior to test (initializing nil pointers via reflect.Pointer/new) so it won’t
reintroduce the deprecated symbol.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d771daa and 7c88549.

📒 Files selected for processing (216)
  • cmd/integration-test/exporters.go
  • cmd/integration-test/http.go
  • cmd/integration-test/integration-test.go
  • cmd/integration-test/javascript.go
  • cmd/nuclei/main.go
  • cmd/tmc/main.go
  • cmd/tmc/types.go
  • internal/colorizer/colorizer.go
  • internal/runner/lazy.go
  • internal/runner/options_test.go
  • internal/runner/runner.go
  • internal/server/nuclei_sdk.go
  • pkg/authprovider/authx/dynamic.go
  • pkg/catalog/config/constants.go
  • pkg/catalog/config/nucleiconfig.go
  • pkg/catalog/config/template.go
  • pkg/catalog/index/filter.go
  • pkg/catalog/index/filter_test.go
  • pkg/catalog/index/index_test.go
  • pkg/fuzz/analyzers/analyzers.go
  • pkg/fuzz/analyzers/time/analyzer.go
  • pkg/fuzz/component/body.go
  • pkg/fuzz/component/body_test.go
  • pkg/fuzz/component/component.go
  • pkg/fuzz/component/cookie.go
  • pkg/fuzz/component/cookie_test.go
  • pkg/fuzz/component/headers.go
  • pkg/fuzz/component/headers_test.go
  • pkg/fuzz/component/path.go
  • pkg/fuzz/component/path_test.go
  • pkg/fuzz/component/query.go
  • pkg/fuzz/component/query_test.go
  • pkg/fuzz/component/value.go
  • pkg/fuzz/component/value_test.go
  • pkg/fuzz/dataformat/dataformat_test.go
  • pkg/fuzz/dataformat/json.go
  • pkg/fuzz/dataformat/kv.go
  • pkg/fuzz/dataformat/multipart.go
  • pkg/fuzz/dataformat/multipart_test.go
  • pkg/fuzz/dataformat/raw.go
  • pkg/fuzz/execute.go
  • pkg/fuzz/execute_race_test.go
  • pkg/fuzz/fuzz.go
  • pkg/fuzz/fuzz_test.go
  • pkg/fuzz/parts.go
  • pkg/fuzz/stats/simple.go
  • pkg/fuzz/type.go
  • pkg/input/formats/formats.go
  • pkg/input/formats/openapi/downloader.go
  • pkg/input/formats/openapi/downloader_test.go
  • pkg/input/formats/openapi/examples.go
  • pkg/input/formats/openapi/generator.go
  • pkg/input/formats/swagger/downloader.go
  • pkg/input/formats/swagger/downloader_test.go
  • pkg/input/formats/yaml/multidoc_test.go
  • pkg/input/formats/yaml/ytt.go
  • pkg/input/provider/interface.go
  • pkg/input/types/http.go
  • pkg/installer/template.go
  • pkg/js/compiler/compiler.go
  • pkg/js/compiler/pool.go
  • pkg/js/devtools/bindgen/generator.go
  • pkg/js/devtools/bindgen/output.go
  • pkg/js/devtools/tsgen/astutil.go
  • pkg/js/devtools/tsgen/parser.go
  • pkg/js/devtools/tsgen/scrape.go
  • pkg/js/global/scripts.go
  • pkg/js/gojs/gojs.go
  • pkg/js/gojs/set.go
  • pkg/js/libs/ldap/utils.go
  • pkg/js/libs/mssql/memo.mssql.go
  • pkg/js/libs/mysql/memo.mysql.go
  • pkg/js/libs/mysql/memo.mysql_private.go
  • pkg/js/libs/mysql/mysql.go
  • pkg/js/libs/net/net.go
  • pkg/js/libs/oracle/memo.oracle.go
  • pkg/js/libs/pop3/memo.pop3.go
  • pkg/js/libs/postgres/memo.postgres.go
  • pkg/js/libs/rdp/memo.rdp.go
  • pkg/js/libs/redis/memo.redis.go
  • pkg/js/libs/redis/redis.go
  • pkg/js/libs/rsync/memo.rsync.go
  • pkg/js/libs/smb/memo.smb.go
  • pkg/js/libs/smb/memo.smb_private.go
  • pkg/js/libs/smb/memo.smbghost.go
  • pkg/js/libs/ssh/memo.ssh.go
  • pkg/js/libs/structs/structs.go
  • pkg/js/libs/telnet/memo.telnet.go
  • pkg/js/libs/vnc/memo.vnc.go
  • pkg/js/utils/nucleijs.go
  • pkg/js/utils/util.go
  • pkg/model/model.go
  • pkg/model/model_test.go
  • pkg/model/types/severity/severities.go
  • pkg/model/types/severity/severity.go
  • pkg/model/types/severity/severity_test.go
  • pkg/model/types/stringslice/stringslice.go
  • pkg/model/types/stringslice/stringslice_raw.go
  • pkg/model/types/userAgent/user_agent.go
  • pkg/operators/cache/cache_test.go
  • pkg/operators/common/dsl/dsl.go
  • pkg/operators/common/dsl/dsl_test.go
  • pkg/operators/extractors/extract.go
  • pkg/operators/extractors/extract_test.go
  • pkg/operators/extractors/extractor_types.go
  • pkg/operators/matchers/match.go
  • pkg/operators/matchers/match_test.go
  • pkg/operators/matchers/matchers_types.go
  • pkg/operators/matchers/validate.go
  • pkg/operators/operators.go
  • pkg/operators/operators_test.go
  • pkg/output/output.go
  • pkg/progress/progress.go
  • pkg/projectfile/httputil.go
  • pkg/protocols/code/code.go
  • pkg/protocols/common/contextargs/contextargs.go
  • pkg/protocols/common/contextargs/variables.go
  • pkg/protocols/common/expressions/expressions.go
  • pkg/protocols/common/expressions/expressions_test.go
  • pkg/protocols/common/expressions/variables.go
  • pkg/protocols/common/generators/attack_types.go
  • pkg/protocols/common/generators/env.go
  • pkg/protocols/common/generators/generators.go
  • pkg/protocols/common/generators/generators_test.go
  • pkg/protocols/common/generators/load.go
  • pkg/protocols/common/generators/load_test.go
  • pkg/protocols/common/generators/maps.go
  • pkg/protocols/common/generators/maps_bench_test.go
  • pkg/protocols/common/generators/maps_test.go
  • pkg/protocols/common/generators/options.go
  • pkg/protocols/common/generators/options_test.go
  • pkg/protocols/common/generators/slice.go
  • pkg/protocols/common/generators/validate.go
  • pkg/protocols/common/helpers/responsehighlighter/hexdump.go
  • pkg/protocols/common/hosterrorscache/hosterrorscache_test.go
  • pkg/protocols/common/interactsh/interactsh.go
  • pkg/protocols/common/protocolstate/headless.go
  • pkg/protocols/common/protocolstate/memguardian_test.go
  • pkg/protocols/common/replacer/replacer.go
  • pkg/protocols/common/replacer/replacer_test.go
  • pkg/protocols/common/uncover/uncover.go
  • pkg/protocols/common/variables/variables.go
  • pkg/protocols/common/variables/variables_bench_test.go
  • pkg/protocols/common/variables/variables_test.go
  • pkg/protocols/dns/dns.go
  • pkg/protocols/dns/dns_test.go
  • pkg/protocols/dns/dns_types.go
  • pkg/protocols/dns/operators.go
  • pkg/protocols/dns/request.go
  • pkg/protocols/file/operators.go
  • pkg/protocols/headless/engine/action_types.go
  • pkg/protocols/headless/engine/page.go
  • pkg/protocols/headless/engine/util.go
  • pkg/protocols/headless/headless.go
  • pkg/protocols/headless/operators.go
  • pkg/protocols/headless/operators_test.go
  • pkg/protocols/headless/request.go
  • pkg/protocols/http/build_request.go
  • pkg/protocols/http/build_request_test.go
  • pkg/protocols/http/http.go
  • pkg/protocols/http/http_method_types.go
  • pkg/protocols/http/http_test.go
  • pkg/protocols/http/httputils/misc.go
  • pkg/protocols/http/operators.go
  • pkg/protocols/http/operators_test.go
  • pkg/protocols/http/request.go
  • pkg/protocols/http/request_fuzz.go
  • pkg/protocols/http/request_generator.go
  • pkg/protocols/http/request_generator_test.go
  • pkg/protocols/http/request_test.go
  • pkg/protocols/http/signature.go
  • pkg/protocols/http/signer/aws-sign.go
  • pkg/protocols/http/signer/signer.go
  • pkg/protocols/javascript/js.go
  • pkg/protocols/network/network.go
  • pkg/protocols/network/network_input_types.go
  • pkg/protocols/network/operators.go
  • pkg/protocols/network/request.go
  • pkg/protocols/network/request_test.go
  • pkg/protocols/offlinehttp/operators.go
  • pkg/protocols/offlinehttp/operators_test.go
  • pkg/protocols/protocols.go
  • pkg/protocols/ssl/ssl.go
  • pkg/protocols/utils/variables.go
  • pkg/protocols/utils/variables_test.go
  • pkg/protocols/websocket/websocket.go
  • pkg/protocols/whois/whois.go
  • pkg/reporting/exporters/sarif/sarif.go
  • pkg/reporting/format/format_utils.go
  • pkg/reporting/format/format_utils_test.go
  • pkg/reporting/trackers/jira/jira.go
  • pkg/reporting/trackers/linear/jsonutil/jsonutil.go
  • pkg/reporting/trackers/linear/linear.go
  • pkg/scan/charts/echarts.go
  • pkg/templates/cluster.go
  • pkg/templates/compile.go
  • pkg/templates/preprocessors.go
  • pkg/templates/tag_filter.go
  • pkg/templates/tag_filter_test.go
  • pkg/templates/templates.go
  • pkg/templates/types/types.go
  • pkg/testutils/fuzzplayground/server.go
  • pkg/testutils/integration.go
  • pkg/tmplexec/flow/builtin/dedupe.go
  • pkg/tmplexec/flow/flow_executor.go
  • pkg/tmplexec/flow/util.go
  • pkg/tmplexec/flow/vm.go
  • pkg/tmplexec/generic/exec.go
  • pkg/tmplexec/multiproto/multi.go
  • pkg/types/interfaces.go
  • pkg/utils/insertion_ordered_map.go
  • pkg/utils/insertion_ordered_map_test.go
  • pkg/utils/telnetmini/telnet.go
  • pkg/utils/utils.go
  • pkg/utils/yaml/yaml_decode_wrapper.go
  • pkg/workflows/workflows.go

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
pkg/protocols/headless/engine/rules.go (1)

129-129: Optional: inline the "HTTP/1.1" literal into the format string.

Passing a compile-time constant as a %s argument is a residual artifact of the mechanical linter fix. Embedding it directly is cleaner.

♻️ Suggested simplification
-	fmt.Fprintf(&rawReq, "%s %s %s\n", e.Request.Method, e.Request.URL, "HTTP/1.1")
+	fmt.Fprintf(&rawReq, "%s %s HTTP/1.1\n", e.Request.Method, e.Request.URL)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/protocols/headless/engine/rules.go` at line 129, The format call to
fmt.Fprintf in rules.go passes the compile-time constant "HTTP/1.1" as a %s
argument; simplify by inlining that literal into the format string so the call
becomes a two-argument format for e.Request.Method and e.Request.URL (i.e.,
update the fmt.Fprintf invocation that references e.Request.Method and
e.Request.URL to include HTTP/1.1 directly in the format string).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/protocols/headless/engine/rules.go`:
- Line 129: The format call to fmt.Fprintf in rules.go passes the compile-time
constant "HTTP/1.1" as a %s argument; simplify by inlining that literal into the
format string so the call becomes a two-argument format for e.Request.Method and
e.Request.URL (i.e., update the fmt.Fprintf invocation that references
e.Request.Method and e.Request.URL to include HTTP/1.1 directly in the format
string).

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7c88549 and 659a452.

📒 Files selected for processing (11)
  • internal/runner/healthcheck.go
  • lib/sdk_private.go
  • pkg/fuzz/analyzers/time/time_delay.go
  • pkg/js/devtools/scrapefuncs/main.go
  • pkg/js/devtools/tsgen/cmd/tsgen/main.go
  • pkg/js/libs/ldap/utils.go
  • pkg/js/libs/mysql/mysql_private.go
  • pkg/protocols/common/helpers/responsehighlighter/hexdump.go
  • pkg/protocols/headless/engine/rules.go
  • pkg/reporting/reporting.go
  • pkg/utils/utils.go
✅ Files skipped from review due to trivial changes (1)
  • pkg/fuzz/analyzers/time/time_delay.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • pkg/protocols/common/helpers/responsehighlighter/hexdump.go
  • pkg/js/libs/ldap/utils.go

@dwisiswant0 dwisiswant0 mentioned this pull request Feb 26, 2026
4 tasks
@dogancanbakir
Copy link
Member

@neo-by-projectdiscovery-dev create an issue to track failing tests

Copy link
Member

@dogancanbakir dogancanbakir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test fail

Signed-off-by: Dwi Siswanto <git@dw1.io>
@dwisiswant0 dwisiswant0 force-pushed the dwisiswant0/chore/go-fix branch from 659a452 to c27c474 Compare February 26, 2026 15:03
@dwisiswant0 dwisiswant0 changed the title chore: go fix ./... chore: golangci-lint run --fix ./... Feb 26, 2026
Drop global Chrome process sweeping from browser
shutdown.

The `previousPIDs` snapshot + delta kill logic is
unsafe on shared/parallel runners: a test can
classify another test's Chrome as "new" and kill
it during `(*Browser).Close()`, triggering
intermittent Rod panics (use of closed network
connection).

Signed-off-by: Dwi Siswanto <git@dw1.io>
@dwisiswant0
Copy link
Member Author

@coderabbitai resolve

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

✅ Actions performed

Comments resolved. Auto-approval is disabled; enable reviews.request_changes_workflow to approve automatically.

@dogancanbakir dogancanbakir merged commit 70ac8bf into dev Mar 4, 2026
20 checks passed
@dogancanbakir dogancanbakir deleted the dwisiswant0/chore/go-fix branch March 4, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants