This commit is contained in:
firefart
2025-03-03 00:49:19 +01:00
parent 8064c95ddb
commit ab2b8f33a7
8 changed files with 19 additions and 47 deletions
+3 -1
View File
@@ -18,9 +18,11 @@
"shardulm94.trailing-spaces",
"IBM.output-colorizer",
"github.vscode-github-actions",
"ms-azuretools.vscode-docker",
"task.vscode-task",
"redhat.vscode-yaml",
"usernamehw.errorlens"
"usernamehw.errorlens",
"Gruntfuggly.todo-tree"
]
}
}
-8
View File
@@ -1,8 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
-9
View File
@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
-8
View File
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/gobuster.iml" filepath="$PROJECT_DIR$/.idea/gobuster.iml" />
</modules>
</component>
</project>
Generated
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
+1 -1
View File
@@ -96,7 +96,7 @@ func printProgress(g *libgobuster.Gobuster) {
requestsExpected := g.Progress.RequestsExpected()
percent := float32(requestsIssued) * 100.0 / float32(requestsExpected)
if math.IsNaN(float64(percent)) {
percent = float32(0)
percent = 0.0
}
s := fmt.Sprintf("%sProgress: %d / %d (%3.2f%%)", TERMINAL_CLEAR_LINE, requestsIssued, requestsExpected, percent)
_, _ = fmt.Fprint(os.Stderr, s)
+15 -8
View File
@@ -19,16 +19,23 @@ func TestAdditionalWordsLen(t *testing.T) {
globalOpts := libgobuster.Options{}
for _, x := range tt {
opts := OptionsDir{}
opts.ExtensionsParsed.Set = x.extensions
t.Run(x.testName, func(t *testing.T) {
t.Parallel()
d, _ := New(&globalOpts, &opts, nil)
opts := OptionsDir{}
opts.ExtensionsParsed.Set = x.extensions
calculatedLen := d.AdditionalWordsLen()
wordsLen := len(d.AdditionalWords("dummy"))
d, err := New(&globalOpts, &opts, nil)
if err != nil {
t.Fatalf("got error creating gobusterdir: %v", err)
}
if calculatedLen != wordsLen {
t.Fatalf("Mismatched additional words length: %d got %d generated words %v", calculatedLen, wordsLen, d.AdditionalWords("dummy"))
}
calculatedLen := d.AdditionalWordsLen()
wordsLen := len(d.AdditionalWords("dummy"))
if calculatedLen != wordsLen {
t.Fatalf("Mismatched additional words length: %d got %d generated words %v", calculatedLen, wordsLen, d.AdditionalWords("dummy"))
}
})
}
}
-6
View File
@@ -173,7 +173,6 @@ func TestLineCounter(t *testing.T) {
{"Empty 3", "\r\n", 1}, // these are wrong, but I've found no good way to handle those
}
for _, x := range tt {
x := x // NOTE: https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables
t.Run(x.testName, func(t *testing.T) {
t.Parallel()
r := strings.NewReader(x.s)
@@ -204,7 +203,6 @@ func TestLineCounterSlow(t *testing.T) {
{"Empty 3", "\r\n", 0},
}
for _, x := range tt {
x := x // NOTE: https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables
t.Run(x.testName, func(t *testing.T) {
t.Parallel()
r := strings.NewReader(x.s)
@@ -286,7 +284,6 @@ func TestParseExtensions(t *testing.T) {
}
for _, x := range tt {
x := x // NOTE: https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables
t.Run(x.testName, func(t *testing.T) {
t.Parallel()
ret, err := ParseExtensions(x.extensions)
@@ -333,7 +330,6 @@ func TestParseCommaSeparatedInt(t *testing.T) {
}
for _, x := range tt {
x := x // NOTE: https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables
t.Run(x.stringCodes, func(t *testing.T) {
t.Parallel()
want := NewSet[int]()
@@ -365,7 +361,6 @@ func BenchmarkParseExtensions(b *testing.B) {
}
for _, x := range tt {
x := x // NOTE: https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables
b.Run(x.testName, func(b2 *testing.B) {
for y := 0; y < b2.N; y++ {
_, _ = ParseExtensions(x.extensions)
@@ -390,7 +385,6 @@ func BenchmarkParseCommaSeparatedInt(b *testing.B) {
}
for _, x := range tt {
x := x // NOTE: https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables
b.Run(x.testName, func(b2 *testing.B) {
for y := 0; y < b2.N; y++ {
_, _ = ParseCommaSeparatedInt(x.stringCodes)