repo string | sha string | parent string | subject string | body string | packages list | src_files list | test_files list | parent_status string | fail_to_pass list | before unknown | after unknown | tests unknown | gold_patch string | size dict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FiloSottile__age | 366cc58ca8ff9447bb67a57d77e0821e119c34f7 | 7a8f5005676b7c960ed3cc34e56670958c53c5c2 | internal/bech32: avoid panic on Unicode input | Reported by Joe Doyle of Trail of Bits. | [
".",
"internal/bech32"
] | [
"internal/bech32/bech32.go"
] | [
"age_test.go",
"internal/bech32/bech32_test.go"
] | test_fail | [
"TestDecodeShortDataPart",
"TestParseUnicode",
"TestParseUnicode/age.ParseHybridIdentity",
"TestParseUnicode/age.ParseHybridRecipient",
"TestParseUnicode/age.ParseX25519Identity",
"TestParseUnicode/age.ParseX25519Recipient",
"TestParseUnicode/plugin.ParseIdentity",
"TestParseUnicode/plugin.ParseRecipi... | {
"internal/bech32/bech32.go": "// Copyright (c) 2017 Takatoshi Nakagawa\n// Copyright (c) 2019 The age Authors\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restricti... | {
"internal/bech32/bech32.go": "// Copyright (c) 2017 Takatoshi Nakagawa\n// Copyright (c) 2019 The age Authors\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restricti... | {
"age_test.go": "// Copyright 2019 The age Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage age_test\n\nimport (\n\t\"archive/zip\"\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"log\"\n\t\"os\"\n\t\"... | diff --git a/internal/bech32/bech32.go b/internal/bech32/bech32.go
index a5d8330..087de3d 100644
--- a/internal/bech32/bech32.go
+++ b/internal/bech32/bech32.go
@@ -154,14 +154,21 @@ func Decode(s string) (hrp string, data []byte, err error) {
return "", nil, fmt.Errorf("invalid character human-readable part: s[%d]... | {
"before_chars": 5008,
"patch_lines": 27
} |
TecharoHQ__anubis | 71147b4857b103ec94eaa3ff69148fa77f765778 | cee7871ef8b64f45c1293c03be13a0bfa9f56a90 | fix: respect Accept-Language quality factors in language detection (#1380) | The Accept-Language header parsing was not correctly handling quality | [
"lib/localization"
] | [
"lib/localization/localization.go"
] | [
"lib/localization/localization_test.go"
] | test_fail | [
"TestAcceptLanguageQualityFactors",
"TestAcceptLanguageQualityFactors/en_GB_with_lower_priority_de"
] | {
"lib/localization/localization.go": "package localization\n\nimport (\n\t\"embed\"\n\t\"encoding/json\"\n\t\"net/http\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/TecharoHQ/anubis\"\n\t\"github.com/nicksnyder/go-i18n/v2/i18n\"\n\t\"golang.org/x/text/language\"\n)\n\n//go:embed locales/*.json\nvar localeFS embed.F... | {
"lib/localization/localization.go": "package localization\n\nimport (\n\t\"embed\"\n\t\"encoding/json\"\n\t\"net/http\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/TecharoHQ/anubis\"\n\t\"github.com/nicksnyder/go-i18n/v2/i18n\"\n\t\"golang.org/x/text/language\"\n)\n\n//go:embed locales/*.json\nvar localeFS embed.F... | {
"lib/localization/localization_test.go": "package localization\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http/httptest\"\n\t\"sort\"\n\t\"testing\"\n\n\t\"github.com/nicksnyder/go-i18n/v2/i18n\"\n)\n\nfunc TestLocalizationService(t *testing.T) {\n\tservice := NewLocalizationService()\n\n\tloadingStrMap :... | diff --git a/lib/localization/localization.go b/lib/localization/localization.go
index 6b8d2a6..02189bf 100644
--- a/lib/localization/localization.go
+++ b/lib/localization/localization.go
@@ -81,7 +81,28 @@ func (ls *LocalizationService) GetLocalizerFromRequest(r *http.Request) *i18n.Lo
return i18n.NewLocalizer(bun... | {
"before_chars": 3263,
"patch_lines": 34
} |
abiosoft__colima | 50c1e73fcf566403db17bae64d8505b0d15dcaef | f450fa710b76165866e45ca46a1a3718266a79a7 | net: fix missing network address when emulating a foreign arch (#1638) | vz and krunkit cannot run a foreign architecture, so newConf falls back | [
"environment/vm/lima"
] | [
"environment/vm/lima/daemon.go",
"environment/vm/lima/yaml.go"
] | [
"environment/vm/lima/daemon_test.go",
"environment/vm/lima/yaml_test.go"
] | compile_error | [] | {
"environment/vm/lima/daemon.go": "package lima\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/abiosoft/colima/config\"\n\t\"github.com/abiosoft/colima/daemon\"\n\t\"github.com/abiosoft/colima/daemon/process/inotify\"\n\t\"github.com/abiosoft/colima/daemon/process/vmnet\"\n\t\"github.com/abiosof... | {
"environment/vm/lima/daemon.go": "package lima\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/abiosoft/colima/config\"\n\t\"github.com/abiosoft/colima/daemon\"\n\t\"github.com/abiosoft/colima/daemon/process/inotify\"\n\t\"github.com/abiosoft/colima/daemon/process/vmnet\"\n\t\"github.com/abiosof... | {
"environment/vm/lima/daemon_test.go": "package lima\n\nimport (\n\t\"testing\"\n\n\t\"github.com/abiosoft/colima/config\"\n\t\"github.com/abiosoft/colima/environment\"\n\t\"github.com/abiosoft/colima/environment/vm/lima/limaconfig\"\n\t\"github.com/abiosoft/colima/util\"\n)\n\nfunc Test_usesVmnet(t *testing.T) {\n\... | diff --git a/environment/vm/lima/daemon.go b/environment/vm/lima/daemon.go
index 6336351..594df79 100644
--- a/environment/vm/lima/daemon.go
+++ b/environment/vm/lima/daemon.go
@@ -13,9 +13,16 @@ import (
"github.com/abiosoft/colima/util"
)
+// usesVmnet reports whether the VM networking relies on vmnet.
+// vmnet... | {
"before_chars": 17773,
"patch_lines": 79
} |
antonmedv__fx | 2c634b27d190e1f8cc35013215bcc02dc7b247ac | 91cfbb11cc746ccf9e17349ca982c35000101ae2 | Fix tests | [
"."
] | [
"main.go",
"search.go"
] | [
"main_test.go"
] | compile_error | [] | {
"main.go": "package main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"os\"\n\t\"path\"\n\t\"regexp\"\n\t\"runtime/pprof\"\n\t\"strconv\"\n\n\t\"github.com/charmbracelet/bubbles/key\"\n\t\"github.com/charmbracelet/bubbles/textinput\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/c... | {
"main.go": "package main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"os\"\n\t\"path\"\n\t\"regexp\"\n\t\"runtime/pprof\"\n\t\"strconv\"\n\n\t\"github.com/charmbracelet/bubbles/key\"\n\t\"github.com/charmbracelet/bubbles/textinput\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/c... | {
"main_test.go": "package main\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"os\"\n\t\"testing\"\n\t\"time\"\n\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/lipgloss\"\n\t\"github.com/charmbracelet/x/exp/teatest\"\n\t\"github.com/muesli/termenv\"\n\t\"github.com/stretchr/testify/require\"\n)\... | diff --git a/main.go b/main.go
index 1260472..f2dfd83 100644
--- a/main.go
+++ b/main.go
@@ -129,7 +129,7 @@ func main() {
fileName: fileName,
digInput: digInput,
searchInput: searchInput,
- search: NewSearch(),
+ search: newSearch(),
}
p := tea.NewProgram(m, tea.WithAltScreen(), tea.Wi... | {
"before_chars": 18152,
"patch_lines": 35
} | |
apache__casbin | d3e9928ab07b200efa0132f99fa095c084597897 | 0dd2ea76ef0c7007b3fe22ce3c6905799bac0f4f | fix: preserve policy order in Model.RemovePolicy | [
"."
] | [
"model/policy.go"
] | [
"model_test.go"
] | test_fail | [
"TestPriorityExplicitRemovePolicyKeepsOrder"
] | {
"model/policy.go": "// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0... | {
"model/policy.go": "// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0... | {
"model_test.go": "// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0 (... | diff --git a/model/policy.go b/model/policy.go
index d4e4899..7669dfe 100644
--- a/model/policy.go
+++ b/model/policy.go
@@ -267,14 +267,15 @@ func (model Model) RemovePolicy(sec string, ptype string, rule []string) (bool,
return false, nil
}
- lastIdx := len(ast.Policy) - 1
- if index != lastIdx {
- ast.Policy... | {
"before_chars": 13672,
"patch_lines": 27
} | |
asdf-vm__asdf | ca98e44ff49cb0a38966b23b42db962203478b59 | 419e2da7d7785d42d621f1c4fa93b7793cd18168 | fix: never generate a shim named "asdf" during reshim (#2307) | Co-authored-by: Trevor Brown <admin@stratus3d.com> | [
"internal/shims"
] | [
"internal/shims/shims.go"
] | [
"internal/shims/shims_test.go"
] | compile_error | [] | {
"internal/shims/shims.go": "// Package shims manages writing and parsing of asdf shim scripts.\npackage shims\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"github.com/asdf-vm/asdf/internal/config\"\n\t\"github.com/asdf-vm/... | {
"internal/shims/shims.go": "// Package shims manages writing and parsing of asdf shim scripts.\npackage shims\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"github.com/asdf-vm/asdf/internal/config\"\n\t\"github.com/asdf-vm/... | {
"internal/shims/shims_test.go": "package shims\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/asdf-vm/asdf/internal/config\"\n\t\"github.com/asdf-vm/asdf/internal/installs\"\n\t\"github.com/asdf-vm/asdf/internal/installtest\"\n\t\"github.com/asdf-... | diff --git a/internal/shims/shims.go b/internal/shims/shims.go
index a7b083f..4472e0b 100644
--- a/internal/shims/shims.go
+++ b/internal/shims/shims.go
@@ -24,6 +24,13 @@ import (
const shimDirName = "shims"
+var reservedShimNames = map[string]bool{
+ // shims named `asdf` must never be generated, since it would ... | {
"before_chars": 13807,
"patch_lines": 41
} |
bluenviron__mediamtx | 344d8c9003f4ef7ca94066c2f3c8dbb624a9c2ce | 8402a728e6e1d819cd0c8045d231fd0191d04998 | fix external command exit code reporting on non-Windows platforms (#6155) | [
"internal/externalcmd"
] | [
"internal/externalcmd/cmd_os.go"
] | [
"internal/externalcmd/cmd_test.go"
] | test_fail | [
"TestCmdExitCode",
"TestCmdExitCode/restart",
"TestCmdExitCode/standard"
] | {
"internal/externalcmd/cmd_os.go": "//go:build !windows\n\npackage externalcmd\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"syscall\"\n\n\t\"github.com/kballard/go-shellquote\"\n)\n\nfunc (c *Cmd) runOSSpecific(cmdstr string, env []string) error {\n\tcmdParts, err := shellquote.Split(cmdstr)\n\... | {
"internal/externalcmd/cmd_os.go": "//go:build !windows\n\npackage externalcmd\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"syscall\"\n\n\t\"github.com/kballard/go-shellquote\"\n)\n\nfunc (c *Cmd) runOSSpecific(cmdstr string, env []string) error {\n\tcmdParts, err := shellquote.Split(cmdstr)\n\... | {
"internal/externalcmd/cmd_test.go": "package externalcmd\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestCmdRunExpandAfterSplit(t *testing.T) {\n\t// if os.Expand runs before shellquote.Split, a variable value containing a\n\t// singl... | diff --git a/internal/externalcmd/cmd_os.go b/internal/externalcmd/cmd_os.go
index 2b9678b..bc463fd 100644
--- a/internal/externalcmd/cmd_os.go
+++ b/internal/externalcmd/cmd_os.go
@@ -44,7 +44,7 @@ func (c *Cmd) runOSSpecific(cmdstr string, env []string) error {
return 0
}
if ee, ok := errors.AsType[*exec... | {
"before_chars": 1170,
"patch_lines": 13
} | |
caddyserver__caddy | a75817f5500c5210a3892a21e4e712477b2fdadc | 425a3381fdf65c826dd991c92e78eaf6ef24941e | fix: require module path boundaries when matching packages (#7957) | Signed-off-by: wangjingshuiku <wangjingshuiku@163.com> | [
"cmd"
] | [
"cmd/packagesfuncs.go"
] | [
"cmd/packagesfuncs_test.go"
] | compile_error | [] | {
"cmd/packagesfuncs.go": "// Copyright 2015 Matthew Holt and The Caddy Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-... | {
"cmd/packagesfuncs.go": "// Copyright 2015 Matthew Holt and The Caddy Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-... | {
"cmd/packagesfuncs_test.go": "package caddycmd\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"testing\"\n)\n\ntype trackingReadCloser struct {\n\t*bytes.Reader\n\tclosed bool\n}\n\nfunc (r *trackingReadCloser) Close() error {\n\tr.closed = true\n\treturn nil\n}\n\nfunc TestDownloadBuildClose... | diff --git a/cmd/packagesfuncs.go b/cmd/packagesfuncs.go
index 58d9b61..014442c 100644
--- a/cmd/packagesfuncs.go
+++ b/cmd/packagesfuncs.go
@@ -253,7 +253,7 @@ func getModules() (standard, nonstandard, unknown []moduleInfo, err error) {
// longest matching prefix in case there are nested modules
var matched *deb... | {
"before_chars": 11441,
"patch_lines": 33
} |
charmbracelet__bubbletea | c76509a9d4974207cd66255707d14f4f938f7f52 | c30088fd4e8f3983ecf556983893716ac452035f | fix: compact sequences like batches (#958) | [
"."
] | [
"commands.go"
] | [
"commands_test.go"
] | test_fail | [
"TestSequence",
"TestSequence/empty_cmd",
"TestSequence/mixed_nil_cmds",
"TestSequence/nil_cmd",
"TestSequence/single_cmd"
] | {
"commands.go": "package tea\n\nimport (\n\t\"time\"\n)\n\n// Batch performs a bunch of commands concurrently with no ordering guarantees\n// about the results. Use a Batch to return several commands.\n//\n// Example:\n//\n//\t func (m model) Init() Cmd {\n//\t\t return tea.Batch(someCommand, someOtherComma... | {
"commands.go": "package tea\n\nimport (\n\t\"time\"\n)\n\n// Batch performs a bunch of commands concurrently with no ordering guarantees\n// about the results. Use a Batch to return several commands.\n//\n// Example:\n//\n//\t func (m model) Init() Cmd {\n//\t\t return tea.Batch(someCommand, someOtherComma... | {
"commands_test.go": "package tea\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestEvery(t *testing.T) {\n\texpected := \"every ms\"\n\tmsg := Every(time.Millisecond, func(t time.Time) Msg {\n\t\treturn expected\n\t})()\n\tif expected != msg {\n\t\tt.Fatalf(\"expected a msg %v but got %v\", expected,... | diff --git a/commands.go b/commands.go
index bfa3b70..ec9dac2 100644
--- a/commands.go
+++ b/commands.go
@@ -13,6 +13,27 @@ import (
// return tea.Batch(someCommand, someOtherCommand)
// }
func Batch(cmds ...Cmd) Cmd {
+ return compactCmds[BatchMsg](cmds)
+}
+
+// BatchMsg is a message used to perform a ... | {
"before_chars": 5570,
"patch_lines": 60
} | |
charmbracelet__glow | 54dd62a2a43d36e10d075b2b3fe9b0f637f2e2b9 | 9a3f7a19cbc8b5f272f798041f5f2917c3ccbb27 | fix: handle running inside a snap (#527) | * fix: handle running inside a snap | [
"editor"
] | [
"config_cmd.go",
"editor/editor.go",
"ui/editor.go"
] | [
"editor/editor_test.go"
] | compile_error | [] | {
"config_cmd.go": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\n\t\"github.com/charmbracelet/glow/editor\"\n\tgap \"github.com/muesli/go-app-paths\"\n\t\"github.com/spf13/cobra\"\n)\n\nconst defaultConfig = `# style name or JSON path (default \"auto\")\nstyle: \"auto\"\n# show lo... | {
"config_cmd.go": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\n\t\"github.com/charmbracelet/glow/editor\"\n\tgap \"github.com/muesli/go-app-paths\"\n\t\"github.com/spf13/cobra\"\n)\n\nconst defaultConfig = `# style name or JSON path (default \"auto\")\nstyle: \"auto\"\n# show lo... | {
"editor/editor_test.go": "package editor\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestEditor(t *testing.T) {\n\tfilename := \"README.md\"\n\tfor k, v := range map[string][]string{\n\t\t\"\": {\"nano\", filename},\n\t\t\"nvim\": {\"nvim\", filename},\n\t\t\"vim\": {\"vim\", f... | diff --git a/config_cmd.go b/config_cmd.go
index a4cb584..caeaac7 100644
--- a/config_cmd.go
+++ b/config_cmd.go
@@ -23,13 +23,14 @@ pager: false
width: 80`
var configCmd = &cobra.Command{
- Use: "config",
- Hidden: false,
- Short: "Edit the glow config file",
- Long: paragraph(fmt.Sprintf("\n%s the glow ... | {
"before_chars": 2814,
"patch_lines": 83
} |
charmbracelet__gum | 19e79b11e46387e9d1dd839778a4ffe2ad14afcd | 93da22d656e810ecd6ceb0dfe0375fdab8748a38 | fix(confirm): `--timeout` was being ignored (#697) | * fix(confirm) Options.Timeout was ignored, now works as documented | [
"confirm"
] | [
"confirm/command.go"
] | [
"confirm/command_test.go"
] | compile_error | [] | {
"confirm/command.go": "package confirm\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/charmbracelet/huh\"\n)\n\n// Run provides a shell script interface for prompting a user to confirm an\n// action with an affirmative or negative answer.\nfunc (o Options) Run() error {\n\ttheme := huh.ThemeCharm()\n\ttheme.Foc... | {
"confirm/command.go": "package confirm\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/charmbracelet/huh\"\n)\n\n// Run provides a shell script interface for prompting a user to confirm an\n// action with an affirmative or negative answer.\nfunc (o Options) Run() error {\n\ttheme := huh.ThemeCharm(... | {
"confirm/command_test.go": "package confirm\n\nimport (\n\t\"fmt\"\n\t\"github.com/charmbracelet/huh\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestOptions_errIsValidTimeout(t *testing.T) {\n\ttype testCase struct {\n\t\tDescription string\n\t\tGivenTimeout time.Duration\n\t\tGivenError error\n\t\tExpectedRes... | diff --git a/confirm/command.go b/confirm/command.go
index 30fd51d..87f6065 100644
--- a/confirm/command.go
+++ b/confirm/command.go
@@ -1,6 +1,7 @@
package confirm
import (
+ "errors"
"fmt"
"os"
@@ -26,12 +27,15 @@ func (o Options) Run() error {
Value(&choice),
),
).
+ WithTimeout(o.Timeout).
W... | {
"before_chars": 797,
"patch_lines": 41
} |
docker__compose | 95929928c1e1762ab7f86a07c8e2f71e94cbce38 | bb22a260e892fc92406a0692b4520b3b8baec765 | fix(provider): drop the relay's capabilities to the strict minimum | The relay only dials an upstream and forwards bytes: it needs none of | [
"pkg/compose"
] | [
"pkg/compose/relay.go"
] | [
"pkg/compose/relay_test.go"
] | test_fail | [
"TestCreateRelayContainerDropsCapabilities"
] | {
"pkg/compose/relay.go": "/*\n Copyright 2020 Docker Compose CLI authors\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n ... | {
"pkg/compose/relay.go": "/*\n Copyright 2020 Docker Compose CLI authors\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n ... | {
"pkg/compose/relay_test.go": "/*\n Copyright 2020 Docker Compose CLI authors\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0... | diff --git a/pkg/compose/relay.go b/pkg/compose/relay.go
index d6a0f43..8d078aa 100644
--- a/pkg/compose/relay.go
+++ b/pkg/compose/relay.go
@@ -332,6 +332,13 @@ func (s *composeService) createRelayContainer(ctx context.Context, project *type
RestartPolicy: container.RestartPolicy{
Name: container.RestartPolicyU... | {
"before_chars": 16183,
"patch_lines": 18
} |
evanw__esbuild | ab50d91559a27e54cd0a27a403389130ea10d97d | 04627b6cf99b4a7491bebb0268173a7c77a85030 | css: fix green/blue channel swap in oklch gamut mapping (#4488) | gamut_mapping_xyz_to_srgb called srgb_to_oklab(clipped_r, clipped_b, | [
"internal/css_parser"
] | [
"internal/css_parser/css_color_spaces.go"
] | [
"internal/css_parser/css_parser_test.go"
] | test_fail | [
"TestColorFunctions",
"TestColorFunctions/a_{_color:_oklch(0.65_0.3_50)_}_[lower]",
"TestColorFunctions/a_{_color:_oklch(0.8_0.3_200)_}_[lower]",
"TestGradient",
"TestGradient/a_{_background:_conic-gradient(yellow,_color(display-p3_1_0_0))_}_[lower]",
"TestGradient/a_{_background:_linear-gradient(yellow,_... | {
"internal/css_parser/css_color_spaces.go": "package css_parser\n\nimport (\n\t\"math\"\n\n\t\"github.com/evanw/esbuild/internal/helpers\"\n)\n\n// Wrap float64 math to avoid compiler optimizations that break determinism\ntype F64 = helpers.F64\n\n// Reference: https://drafts.csswg.org/css-color/#color-conversion-co... | {
"internal/css_parser/css_color_spaces.go": "package css_parser\n\nimport (\n\t\"math\"\n\n\t\"github.com/evanw/esbuild/internal/helpers\"\n)\n\n// Wrap float64 math to avoid compiler optimizations that break determinism\ntype F64 = helpers.F64\n\n// Reference: https://drafts.csswg.org/css-color/#color-conversion-co... | {
"internal/css_parser/css_parser_test.go": "package css_parser\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/evanw/esbuild/internal/ast\"\n\t\"github.com/evanw/esbuild/internal/compat\"\n\t\"github.com/evanw/esbuild/internal/config\"\n\t\"github.com/evanw/esbuild/internal/css_printer\"\n\t\"... | diff --git a/internal/css_parser/css_color_spaces.go b/internal/css_parser/css_color_spaces.go
index 721ecd3..03c5efb 100644
--- a/internal/css_parser/css_color_spaces.go
+++ b/internal/css_parser/css_color_spaces.go
@@ -437,7 +437,7 @@ func gamut_mapping_xyz_to_srgb(x F64, y F64, z F64) (F64, F64, F64) {
}
cli... | {
"before_chars": 16179,
"patch_lines": 13
} |
fatedier__frp | 832df8dff66d1b0caa0d776c450418f982756df1 | ebb4773c2cd4a654f4e145f5770ac9d251b2470f | fix(health): reset failed count after successful check (#5502) | Signed-off-by: racequite <quiterace@gmail.com> | [
"client/health"
] | [
"client/health/health.go"
] | [
"client/health/health_test.go"
] | test_fail | [
"TestMonitorResetsFailedTimesAfterSuccess"
] | {
"client/health/health.go": "// Copyright 2018 fatedier, fatedier@gmail.com\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0... | {
"client/health/health.go": "// Copyright 2018 fatedier, fatedier@gmail.com\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0... | {
"client/health/health_test.go": "// Copyright 2026 The frp Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n//... | diff --git a/client/health/health.go b/client/health/health.go
index d298e615..8cb1122a 100644
--- a/client/health/health.go
+++ b/client/health/health.go
@@ -119,6 +119,7 @@ func (monitor *Monitor) checkWorker() {
if err == nil {
xl.Tracef("do one health check success")
+ monitor.failedTimes = 0
if !mon... | {
"before_chars": 4351,
"patch_lines": 12
} |
filebrowser__filebrowser | c05c66814891c3cccef394162e428444b53394e4 | b7dc392838f11d188f0bc0f2a1a99fad3f7dca03 | fix: process --FollowExternalSymlinks | [
"cmd"
] | [
"cmd/config.go"
] | [
"cmd/cmd_test.go"
] | test_fail | [
"TestGetSettingsFollowExternalSymlinks"
] | {
"cmd/config.go": "package cmd\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"text/tabwriter\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/pflag\"\n\n\t\"github.com/filebrowser/filebrowser/v2/auth\"\n\tfberrors \"github.com/filebrowser/filebrowser/v2/errors\"\n\t\"g... | {
"cmd/config.go": "package cmd\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"text/tabwriter\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/pflag\"\n\n\t\"github.com/filebrowser/filebrowser/v2/auth\"\n\tfberrors \"github.com/filebrowser/filebrowser/v2/errors\"\n\t\"g... | {
"cmd/cmd_test.go": "package cmd\n\nimport (\n\t\"testing\"\n\n\t\"github.com/samber/lo\"\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/pflag\"\n\n\t\"github.com/filebrowser/filebrowser/v2/auth\"\n\t\"github.com/filebrowser/filebrowser/v2/settings\"\n)\n\n// TestEnvCollisions ensures that there are no collisio... | diff --git a/cmd/config.go b/cmd/config.go
index cf923ea..b292f01 100644
--- a/cmd/config.go
+++ b/cmd/config.go
@@ -314,6 +314,8 @@ func getSettings(flags *pflag.FlagSet, set *settings.Settings, ser *settings.Ser
case "disableImageResolutionCalc":
ser.ImageResolutionCal, err = flags.GetBool(flag.Name)
ser.I... | {
"before_chars": 12944,
"patch_lines": 13
} | |
gin-gonic__gin | 3b08cd7235bd5ad2f055aa9e38135f111f6c5926 | d8f2d588d7573b3438cfc95b7a47f9ec8966273c | fix: reset skipped-nodes stack on getValue entry to prevent slice overflow panic [#4818] (#4819) | * fix: reset skipped-nodes stack on getValue entry to prevent slice overflow panic [#4818] | [
"."
] | [
"tree.go"
] | [
"routes_test.go"
] | test_fail | [
"TestIssue4818_skippedNodesOverflow_Panic"
] | {
"tree.go": "// Copyright 2013 Julien Schmidt. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be found\n// at https://github.com/julienschmidt/httprouter/blob/master/LICENSE\n\npackage gin\n\nimport (\n\t\"net/url\"\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n\n\t... | {
"tree.go": "// Copyright 2013 Julien Schmidt. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be found\n// at https://github.com/julienschmidt/httprouter/blob/master/LICENSE\n\npackage gin\n\nimport (\n\t\"net/url\"\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n\n\t... | {
"routes_test.go": "// Copyright 2014 Manu Martinez-Almeida. All rights reserved.\n// Use of this source code is governed by a MIT style\n// license that can be found in the LICENSE file.\n\npackage gin\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\... | diff --git a/tree.go b/tree.go
index dc84ff6..6efe2e0 100644
--- a/tree.go
+++ b/tree.go
@@ -418,6 +418,14 @@ type skippedNode struct {
func (n *node) getValue(path string, params *Params, skippedNodes *[]skippedNode, unescape bool) (value nodeValue) {
var globalParamsCount int16
+ // Reset the skipped-nodes stack... | {
"before_chars": 24441,
"patch_lines": 19
} |
gitleaks__gitleaks | b6cc71aa3a945711f1829a2548e5fef4794a17b8 | cfdeb0d7e01bfc674e5181e9a223b280ae7dc0c6 | fix(baseline): work with --redact (#1741) | [
"detect"
] | [
"detect/baseline.go",
"detect/detect.go"
] | [
"detect/baseline_test.go"
] | compile_error | [] | {
"detect/baseline.go": "package detect\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/zricethezav/gitleaks/v8/report\"\n)\n\nfunc IsNew(finding report.Finding, baseline []report.Finding) bool {\n\t// Explicitly testing each property as it gives significantly better perfo... | {
"detect/baseline.go": "package detect\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/zricethezav/gitleaks/v8/report\"\n)\n\nfunc IsNew(finding report.Finding, redact uint, baseline []report.Finding) bool {\n\t// Explicitly testing each property as it gives significantly... | {
"detect/baseline_test.go": "package detect\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\n\t\"github.com/zricethezav/gitleaks/v8/report\"\n)\n\nfunc TestIsNew(t *testing.T) {\n\tt.Parallel()\n\ttests := map[string]struct {\n\t\tfind... | diff --git a/detect/baseline.go b/detect/baseline.go
index bd3e634..d0520fd 100644
--- a/detect/baseline.go
+++ b/detect/baseline.go
@@ -9,27 +9,25 @@ import (
"github.com/zricethezav/gitleaks/v8/report"
)
-func IsNew(finding report.Finding, baseline []report.Finding) bool {
+func IsNew(finding report.Finding, red... | {
"before_chars": 20751,
"patch_lines": 57
} | |
go-chi__chi | aba86186a27484f3cadc55b8d6448d2049af71bf | 735ae2b87f8c733d616e809ae86e0985c1bc3350 | fix: panic on Mount() when a router is mounted onto itself (#1159) | * fix: panic on Mount() when a router is mounted onto itself | [
"."
] | [
"mux.go"
] | [
"mux_test.go"
] | test_fail | [
"TestMountingSelf",
"TestMountingSelf/direct_self-mount",
"TestMountingSelf/mount_of_inline_mux_sharing_the_same_tree"
] | {
"mux.go": "package chi\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"sync\"\n)\n\nvar _ Router = &Mux{}\n\n// Mux is a simple HTTP route multiplexer that parses a request path,\n// records any URL params, and executes an end handler. It implements\n// the http.Handler interface and is fr... | {
"mux.go": "package chi\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"sync\"\n)\n\nvar _ Router = &Mux{}\n\n// Mux is a simple HTTP route multiplexer that parses a request path,\n// records any URL params, and executes an end handler. It implements\n// the http.Handler interface and is fr... | {
"mux_test.go": "package chi\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestMuxBasic(t *testing.T) {\n\tvar count uint64\n\tcountermw := func(next http.Handler) http.Handler {\n\t\treturn http.Hand... | diff --git a/mux.go b/mux.go
index 37cd500..234d74a 100644
--- a/mux.go
+++ b/mux.go
@@ -305,6 +305,14 @@ func (mx *Mux) Mount(pattern string, handler http.Handler) {
// Assign sub-Router's with the parent not found & method not allowed handler if not specified.
subr, ok := handler.(*Mux)
+
+ // Provide runtime s... | {
"before_chars": 16981,
"patch_lines": 19
} |
go-delve__delve | 1f83848a4c32fa5c94b9c524017d10b33862a82c | d3cb0508b86212286763986569f1758381e6e848 | dwarf/op: fix DW_OP_shr and DW_OP_shra evaluation (#4296) | * dwarf/op: fix DW_OP_shr and DW_OP_shra evaluation | [
"pkg/dwarf/op"
] | [
"pkg/dwarf/op/op.go"
] | [
"pkg/dwarf/op/op_test.go"
] | test_fail | [
"TestBinaryOp_ShrVsShra_NegativeShiftedValue"
] | {
"pkg/dwarf/op/op.go": "package op\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/go-delve/delve/pkg/dwarf\"\n\t\"github.com/go-delve/delve/pkg/dwarf/leb128\"\n)\n\n// Opcode represent a DWARF stack program instruction.\n// See ./opcodes.go for a full list.\ntype... | {
"pkg/dwarf/op/op.go": "package op\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/go-delve/delve/pkg/dwarf\"\n\t\"github.com/go-delve/delve/pkg/dwarf/leb128\"\n)\n\n// Opcode represent a DWARF stack program instruction.\n// See ./opcodes.go for a full list.\ntype... | {
"pkg/dwarf/op/op_test.go": "package op\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc assertExprResult(t *testing.T, expected int64, instructions []byte) {\n\tt.Helper()\n\tactual, _, err := ExecuteStackProgram(DwarfRegisters{}, instructions, 8, nil)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif actual != e... | diff --git a/pkg/dwarf/op/op.go b/pkg/dwarf/op/op.go
index c8694fc..45bccef 100644
--- a/pkg/dwarf/op/op.go
+++ b/pkg/dwarf/op/op.go
@@ -444,9 +444,9 @@ func binaryop(opcode Opcode, ctxt *context) error {
case DW_OP_shl:
r = second << uint64(top)
case DW_OP_shr:
- r = second >> uint64(top)
- case DW_OP_shra:
... | {
"before_chars": 14176,
"patch_lines": 16
} |
go-gorm__gorm | 61520d7476a5b08cf09439da7bb2628f86d2cd25 | 01916e711737392edf158b1df4ceb48c8d24ddfd | fix(utils): restore FileWithLineNum caller depth and add regression test (#7717) | [
"utils"
] | [
"utils/utils.go"
] | [
"utils/utils_test.go"
] | test_fail | [
"TestFileWithLineNumWrappedCallRegression"
] | {
"utils/utils.go": "package utils\n\nimport (\n\t\"database/sql/driver\"\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nvar gormSourceDir string\n\nfunc init() {\n\t_, file, _, _ := runtime.Caller(0)\n\t// compatible solution to get gorm source direct... | {
"utils/utils.go": "package utils\n\nimport (\n\t\"database/sql/driver\"\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nvar gormSourceDir string\n\nfunc init() {\n\t_, file, _, _ := runtime.Caller(0)\n\t// compatible solution to get gorm source direct... | {
"utils/utils_test.go": "package utils\n\nimport (\n\t\"database/sql\"\n\t\"database/sql/driver\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestIsInvalidDBNameChar(t *testing.T) {\n\tfor _, db := range []string{\"db\", \"dbName\", \"... | diff --git a/utils/utils.go b/utils/utils.go
index 7e59264..cf815a0 100644
--- a/utils/utils.go
+++ b/utils/utils.go
@@ -36,9 +36,14 @@ func sourceDir(file string) string {
// - Exclude test files (*_test.go)
// - go-gorm/gen's Generated files (*.gen.go)
func CallerFrame() runtime.Frame {
+ // Preserve the origi... | {
"before_chars": 4635,
"patch_lines": 31
} | |
go-kit__kit | 0e6a1b1cc32caa3f1506098107384240e2a11ae2 | 6ed2328dbb52ba4d056bf9c0afe418a4b3e205b7 | Fixed instancer logic for Consul (#1215) | The instancer loop was never updating the lastIndex but passing it to getInstances which caused Instancer to spam Consul repeatedly and nearly killed our Consul agent pods and time instances were added or removed from Consul for that service. | [
"sd/consul"
] | [
"sd/consul/instancer.go"
] | [
"sd/consul/instancer_test.go"
] | test_fail | [
"TestInstancerLoopIndex"
] | {
"sd/consul/instancer.go": "package consul\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"time\"\n\n\tconsul \"github.com/hashicorp/consul/api\"\n\n\t\"github.com/go-kit/kit/sd\"\n\t\"github.com/go-kit/kit/sd/internal/instance\"\n\t\"github.com/go-kit/kit/util/conn\"\n\t\"github.com/go-kit/log\"\n)\n\nconst defaultIndex ... | {
"sd/consul/instancer.go": "package consul\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"time\"\n\n\tconsul \"github.com/hashicorp/consul/api\"\n\n\t\"github.com/go-kit/kit/sd\"\n\t\"github.com/go-kit/kit/sd/internal/instance\"\n\t\"github.com/go-kit/kit/util/conn\"\n\t\"github.com/go-kit/log\"\n)\n\nconst defaultIndex ... | {
"sd/consul/instancer_test.go": "package consul\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"testing\"\n\t\"time\"\n\n\tconsul \"github.com/hashicorp/consul/api\"\n\n\t\"github.com/go-kit/kit/sd\"\n\t\"github.com/go-kit/log\"\n)\n\nvar _ sd.Instancer = (*Instancer)(nil) // API check\n\nvar consulState = []*c... | diff --git a/sd/consul/instancer.go b/sd/consul/instancer.go
index 1110665..3215695 100644
--- a/sd/consul/instancer.go
+++ b/sd/consul/instancer.go
@@ -65,9 +65,9 @@ func (s *Instancer) loop(lastIndex uint64) {
instances []string
err error
d time.Duration = 10 * time.Millisecond
+ index uin... | {
"before_chars": 4476,
"patch_lines": 29
} |
go-kratos__kratos | 4ed1bedbb0244bd139d4a2aa75725aee2322c6d5 | 1393e857d98dc346bffa449d8ca1e96c0b1f355c | fix(transport/http): clone transport before applying TLSClientConfig to avoid mutating http.DefaultTransport (#3808) | * Initial plan | [
"transport/http"
] | [
"encoding/json/json.go",
"transport/http/client.go"
] | [
"transport/http/client_test.go"
] | test_fail | [
"TestNewClientWithTLSDoesNotModifyDefaultTransport"
] | {
"encoding/json/json.go": "package json\n\nimport (\n\t\"encoding/json\"\n\t\"reflect\"\n\n\t\"google.golang.org/protobuf/encoding/protojson\"\n\t\"google.golang.org/protobuf/proto\"\n\n\t\"github.com/go-kratos/kratos/v2/encoding\"\n)\n\n// Name is the name registered for the json codec.\nconst Name = \"json\"\n\nva... | {
"encoding/json/json.go": "package json\n\nimport (\n\t\"encoding/json\"\n\t\"reflect\"\n\n\t\"google.golang.org/protobuf/encoding/protojson\"\n\t\"google.golang.org/protobuf/proto\"\n\n\t\"github.com/go-kratos/kratos/v2/encoding\"\n)\n\n// Name is the name registered for the json codec.\nconst Name = \"json\"\n\nva... | {
"transport/http/client_test.go": "package http\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"crypto/tls\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"testing\"\n\t\"time\"\n\n\tkratoserrors \"github.com/go-kratos/kratos/v2/errors\"\n\t\"github... | diff --git a/encoding/json/json.go b/encoding/json/json.go
index ab0d5e1..5070c76 100644
--- a/encoding/json/json.go
+++ b/encoding/json/json.go
@@ -43,7 +43,7 @@ func (codec) Marshal(v any) ([]byte, error) {
}
func (codec) Unmarshal(data []byte, v any) error {
- if len(data) == 0 {
+ if len(data) == 0 {
return... | {
"before_chars": 11494,
"patch_lines": 28
} |
go-playground__validator | 0364541fa467027703223b3d0cace07a667c8302 | 8eb2659789a33bda9262ce62eed2d714539dc8c5 | fix(cron): anchor regex and accept full cron syntax (#1577) | The cron validator's regex lacked `^...$` anchors, so any string | [
"."
] | [
"regexes.go"
] | [
"validator_test.go"
] | test_fail | [
"TestCronExpressionValidation"
] | {
"regexes.go": "package validator\n\nimport (\n\t\"regexp\"\n\t\"sync\"\n)\n\nconst (\n\talphaRegexString = \"^[a-zA-Z]+$\"\n\talphaSpaceRegexString = \"^[a-zA-Z ]+$\"\n\talphaNumericRegexString = \"^[a-zA-Z0-9]+$\"\n\talphaNumericSpaceRegexString = \"^[a-zA-Z0-9 ]+$\"\n\talph... | {
"regexes.go": "package validator\n\nimport (\n\t\"regexp\"\n\t\"sync\"\n)\n\nconst (\n\talphaRegexString = \"^[a-zA-Z]+$\"\n\talphaSpaceRegexString = \"^[a-zA-Z ]+$\"\n\talphaNumericRegexString = \"^[a-zA-Z0-9]+$\"\n\talphaNumericSpaceRegexString = \"^[a-zA-Z0-9 ]+$\"\n\talph... | {
"validator_test.go": "package validator\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"database/sql\"\n\t\"database/sql/driver\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"image\"\n\t\"image/jpeg\"\n\t\"image/png\"\n\t\"net\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"runtime\"\... | diff --git a/regexes.go b/regexes.go
index 3abff8a..20c03b8 100644
--- a/regexes.go
+++ b/regexes.go
@@ -77,7 +77,7 @@ const (
cveRegexString = `^CVE-(1999|2\d{3})-(0[^0]\d{2}|0\d[^0]\d{1}|0\d{2}[^0]|[1-9]{1}\d{3,})$` // CVE Format Id https://cve.mitre.org/cve/identifiers/syntaxchange.html
mongodb... | {
"before_chars": 14535,
"patch_lines": 13
} |
gorilla__mux | 976b536446a77de8de2d5559c78f612970fb5e37 | 2b030fc311d07b8c5950807800b03b2d32a7142c | Fixed processing of multiple queries for the same path | [
"."
] | [
"route.go"
] | [
"mux_test.go"
] | test_fail | [
"TestMultipleDefinitionOfSamePathWithDifferentQueries"
] | {
"route.go": "// Copyright 2012 The Gorilla Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage mux\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"regexp\"\n\t\"strings\"\n)\n\n// Route stores inf... | {
"route.go": "// Copyright 2012 The Gorilla Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage mux\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"regexp\"\n\t\"strings\"\n)\n\n// Route stores inf... | {
"mux_test.go": "// Copyright 2012 The Gorilla Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage mux\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\t\... | diff --git a/route.go b/route.go
index cb89ebb..b6582da 100644
--- a/route.go
+++ b/route.go
@@ -87,7 +87,7 @@ func (r *Route) Match(req *http.Request, match *RouteMatch) bool {
return false
}
- if match.MatchErr == ErrMethodMismatch && r.handler != nil {
+ if match.MatchErr != nil && r.handler != nil {
// We... | {
"before_chars": 22659,
"patch_lines": 13
} | |
helm__helm | 9a3c040369361678aef1ab251e83a38b455f5159 | 11e2010aebedf9f495a5c295635df096de7252f7 | fix(template): regression - route registry messages to stderr in template and show (#32217) | * fix: route registry messages to stderr in template and show | [
"pkg/cmd"
] | [
"pkg/cmd/show.go",
"pkg/cmd/template.go"
] | [
"pkg/cmd/registry_output_test.go"
] | test_fail | [
"TestShowOCIRegistryMessagesNotOnStdout",
"TestTemplateOCIRegistryMessagesNotOnStdout"
] | {
"pkg/cmd/show.go": "/*\nCopyright The Helm Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law o... | {
"pkg/cmd/show.go": "/*\nCopyright The Helm Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law o... | {
"pkg/cmd/registry_output_test.go": "/*\nCopyright The Helm Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by ... | diff --git a/pkg/cmd/show.go b/pkg/cmd/show.go
index 8252d933..161a3872 100644
--- a/pkg/cmd/show.go
+++ b/pkg/cmd/show.go
@@ -82,9 +82,9 @@ func newShowCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
Long: showAllDesc,
Args: require.ExactArgs(1),
ValidArgsFunction: val... | {
"before_chars": 16098,
"patch_lines": 88
} |
henrygd__beszel | 6cb302fcf6eb489d299707c0ca1fd796a2cfe5de | 59eed073c3d1ec641c1c64a82c1abcd28ee91214 | fix(hub): bound realtime metric fetching and enforce access control by system | - synchronize realtime subscription state | [
"internal/hub/systems"
] | [
"internal/hub/systems/system_manager.go",
"internal/hub/systems/system_realtime.go"
] | [
"internal/hub/systems/system_realtime_test.go"
] | compile_error | [] | {
"internal/hub/systems/system_manager.go": "package systems\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/henrygd/beszel/internal/hub/ws\"\n\n\t\"github.com/henrygd/beszel/internal/entities/system\"\n\t\"github.com/henrygd/beszel/internal/hub/expirymap\"\n\n\t\"github.com/henrygd/... | {
"internal/hub/systems/system_manager.go": "package systems\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/henrygd/beszel/internal/hub/ws\"\n\n\t\"github.com/henrygd/beszel/internal/entities/system\"\n\t\"github.com/henrygd/beszel/internal/hub/expirymap\"\n\n\t\"github.... | {
"internal/hub/systems/system_realtime_test.go": "package systems\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/pocketbase/pocketbase/apis\"\n\t\"github.com/pocketbase/pocketbase/core\"\n\tpbtests \"github.com/pocketbase/pocketbase/tests\"\n\t\"github.com/pocketbase/pocketbase/tools/hook\"\n\t\"github.com... | diff --git a/internal/hub/systems/system_manager.go b/internal/hub/systems/system_manager.go
index 5c04ea0..c1a4cde 100644
--- a/internal/hub/systems/system_manager.go
+++ b/internal/hub/systems/system_manager.go
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
+ "sync"
"time"
"github.com/henrygd/beszel/in... | {
"before_chars": 20256,
"patch_lines": 355
} |
iawia002__lux | 179d4a95431f5c31178ec4553ed328226720555a | 2d2334d2bbe7a29355b341e11aca91cbbe105927 | fix no streams for newly published rumble videos (#1408) | * fix no streams for newly published rumble videos | [
"extractors/rumble"
] | [
"extractors/rumble/rumble.go"
] | [
"extractors/rumble/rumble_test.go"
] | test_fail | [
"TestRumble",
"TestRumble/normal_test#01"
] | {
"extractors/rumble/rumble.go": "package rumble\n\nimport (\n\t\"compress/flate\"\n\t\"compress/gzip\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"path\"\n\t\"regexp\"\n\t\"strconv\"\n\n\t\"github.com/pkg/errors\"\n\n\t\"github.com/iawia002/lux/extractors\"\n\t\"github.com/iawia002/... | {
"extractors/rumble/rumble.go": "package rumble\n\nimport (\n\t\"compress/flate\"\n\t\"compress/gzip\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"path\"\n\t\"regexp\"\n\t\"strconv\"\n\n\t\"github.com/pkg/errors\"\n\n\t\"github.com/iawia002/lux/extractors\"\n\t\"github.com/iawia002/... | {
"extractors/rumble/rumble_test.go": "package rumble\n\nimport (\n\t\"testing\"\n\n\t\"github.com/iawia002/lux/extractors\"\n\t\"github.com/iawia002/lux/test\"\n)\n\nfunc TestRumble(t *testing.T) {\n\ttests := []struct {\n\t\tname string\n\t\targs test.Args\n\t}{\n\t\t{\n\t\t\tname: \"normal test\",\n\t\t\targs: tes... | diff --git a/extractors/rumble/rumble.go b/extractors/rumble/rumble.go
index d078fc2..a71e33c 100644
--- a/extractors/rumble/rumble.go
+++ b/extractors/rumble/rumble.go
@@ -169,6 +169,7 @@ type rumbleStreams struct {
FHLS struct {
QAuto struct{ streamInfo } `json:"auto"`
} `json:"hls"`
+ FTAR map[string]streamIn... | {
"before_chars": 7770,
"patch_lines": 69
} |
jaegertracing__jaeger | 0db690223f8af4a8ef4ea37ca045696dbe2c6c7f | 98292d8c2ed3b518ac69616efd61df1067b9619a | fix(es): Do not double the separator when index-prefix already ends in "-" (#9551) | Motivation: | [
"cmd/es-index-cleaner/app",
"cmd/es-rollover/app"
] | [
"cmd/es-index-cleaner/app/flags.go",
"cmd/es-rollover/app/flags.go"
] | [
"cmd/es-index-cleaner/app/flags_test.go",
"cmd/es-rollover/app/flags_test.go"
] | test_fail | [
"TestInitFromViper_IndexPrefix",
"TestInitFromViper_IndexPrefix/trailing_dash_already_present"
] | {
"cmd/es-index-cleaner/app/flags.go": "// Copyright (c) 2021 The Jaeger Authors.\n// SPDX-License-Identifier: Apache-2.0\n\npackage app\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\n\t\"github.com/spf13/viper\"\n\t\"go.opentelemetry.io/collector/config/configtls\"\n\t\"go.opentelemetry.io/collector/featuregate\"\n\n\t\"g... | {
"cmd/es-index-cleaner/app/flags.go": "// Copyright (c) 2021 The Jaeger Authors.\n// SPDX-License-Identifier: Apache-2.0\n\npackage app\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"strings\"\n\n\t\"github.com/spf13/viper\"\n\t\"go.opentelemetry.io/collector/config/configtls\"\n\t\"go.opentelemetry.io/collector/feature... | {
"cmd/es-index-cleaner/app/flags_test.go": "// Copyright (c) 2021 The Jaeger Authors.\n// SPDX-License-Identifier: Apache-2.0\n\npackage app\n\nimport (\n\t\"flag\"\n\t\"testing\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/viper\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/... | diff --git a/cmd/es-index-cleaner/app/flags.go b/cmd/es-index-cleaner/app/flags.go
index f263f86..fc5976b 100644
--- a/cmd/es-index-cleaner/app/flags.go
+++ b/cmd/es-index-cleaner/app/flags.go
@@ -6,6 +6,7 @@ package app
import (
"errors"
"flag"
+ "strings"
"github.com/spf13/viper"
"go.opentelemetry.io/colle... | {
"before_chars": 7070,
"patch_lines": 42
} |
jeessy2__ddns-go | 0c5178b78a0a8d50fc45feca5fe38537f637f525 | 600693c3203cc65f90b3a5510cb0af8c02d99913 | fix(cloudflare): preserve proxy status when proxied is unset (#1740) | [
"dns"
] | [
"dns/cloudflare.go"
] | [
"dns/cloudflare_test.go"
] | test_fail | [
"TestCloudflareModifyProxied",
"TestCloudflareModifyProxied/preserve_proxy_status_when_IP_changes",
"TestCloudflareModifyProxied/preserve_proxy_status_without_custom_parameter"
] | {
"dns/cloudflare.go": "package dns\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/jeessy2/ddns-go/v6/config\"\n\t\"github.com/jeessy2/ddns-go/v6/util\"\n)\n\nconst zonesAPI = \"https://api.cloudflare.com/client/v4/zones\"\n\n// ... | {
"dns/cloudflare.go": "package dns\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/jeessy2/ddns-go/v6/config\"\n\t\"github.com/jeessy2/ddns-go/v6/util\"\n)\n\nconst zonesAPI = \"https://api.cloudflare.com/client/v4/zones\"\n\n// ... | {
"dns/cloudflare_test.go": "package dns\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/jeessy2/ddns-go/v6/config\"\n)\n\ntype roundTripFunc func(*http.Request) (*http.Response, error)\n\n// RoundTrip implements http.RoundTripper for Cloudflare request tests... | diff --git a/dns/cloudflare.go b/dns/cloudflare.go
index 5353497..4a6895a 100644
--- a/dns/cloudflare.go
+++ b/dns/cloudflare.go
@@ -188,14 +188,13 @@ func (cf *Cloudflare) create(zoneID string, domain *config.Domain, recordType st
// 修改
func (cf *Cloudflare) modify(result CloudflareRecordsResp, zoneID string, doma... | {
"before_chars": 6291,
"patch_lines": 34
} | |
jmoiron__sqlx | 75a7ebf246fd757c9c7742da7dc4d26c6fdb6b5b | 4cb7f7deb4568d8eb302e8d5fb37dfe20f00cdcc | fixes #688 | The changes in #635 changed the some of the output types of In to | [
"."
] | [
"bind.go"
] | [
"sqlx_test.go"
] | test_fail | [
"TestIn130Regression",
"TestIn130Regression/[]interface{}{}",
"TestIn130Regression/[]string{}"
] | {
"bind.go": "package sqlx\n\nimport (\n\t\"bytes\"\n\t\"database/sql/driver\"\n\t\"errors\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/jmoiron/sqlx/reflectx\"\n)\n\n// Bindvar types supported by Rebind, BindMap and BindStruct.\nconst (\n\tUNKNOWN = iota\n\tQUESTION\n\tDOLLAR\n\tNAMED\... | {
"bind.go": "package sqlx\n\nimport (\n\t\"bytes\"\n\t\"database/sql/driver\"\n\t\"errors\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/jmoiron/sqlx/reflectx\"\n)\n\n// Bindvar types supported by Rebind, BindMap and BindStruct.\nconst (\n\tUNKNOWN = iota\n\tQUESTION\n\tDOLLAR\n\tNAMED\... | {
"sqlx_test.go": "// The following environment variables, if set, will be used:\n//\n//\t* SQLX_SQLITE_DSN\n//\t* SQLX_POSTGRES_DSN\n//\t* SQLX_MYSQL_DSN\n//\n// Set any of these variables to 'skip' to skip them. Note that for MySQL,\n// the string '?parseTime=True' will be appended to the DSN if it's not there\n//... | diff --git a/bind.go b/bind.go
index f683fcb..369d73b 100644
--- a/bind.go
+++ b/bind.go
@@ -249,11 +249,11 @@ func appendReflectSlice(args []interface{}, v reflect.Value, vlen int) []interfa
args = append(args, val...)
case []int:
for i := range val {
- args = append(args, &val[i])
+ args = append(args, va... | {
"before_chars": 6202,
"patch_lines": 18
} |
julienschmidt__httprouter | 34250257ea144905c752bfaae80d6885f190daf6 | 829d723ff8dce371ac6c55a1d68175d2ced8708e | Fix: #322 (#342) | Co-authored-by: yuanyuan <yuanyuan@umu.com> | [
"."
] | [
"tree.go"
] | [
"tree_test.go"
] | test_fail | [
"TestRedirectTrailingSlash"
] | {
"tree.go": "// Copyright 2013 Julien Schmidt. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be found\n// in the LICENSE file.\n\npackage httprouter\n\nimport (\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\nfunc min(a, b int) int {\n\tif a <= b {\n\t\treturn a... | {
"tree.go": "// Copyright 2013 Julien Schmidt. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be found\n// in the LICENSE file.\n\npackage httprouter\n\nimport (\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n)\n\nfunc min(a, b int) int {\n\tif a <= b {\n\t\treturn a... | {
"tree_test.go": "// Copyright 2013 Julien Schmidt. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be found\n// in the LICENSE file.\n\npackage httprouter\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"strings\"\n\t\"testing\"\n)\n\n// func prin... | diff --git a/tree.go b/tree.go
index 6eb4fe6..2d02ccd 100644
--- a/tree.go
+++ b/tree.go
@@ -435,6 +435,11 @@ walk: // Outer loop for walking the tree
return
}
+ if path == "/" && n.nType == static {
+ tsr = true
+ return
+ }
+
// No handle found. Check if a handle for this path + a
// trai... | {
"before_chars": 16645,
"patch_lines": 16
} |
junegunn__fzf | 224310d7a6a6a27b41ab9d82b060978738ce03da | 235a726fae89bec3ac6d3e7facd2716d78bb625d | Fix nondeterministic highlight positions in FuzzyMatchV2 backtrace | Phase 3 writes C rows only from column F[r], but tie-breaking in the | [
"src/algo"
] | [
"src/algo/algo.go"
] | [
"src/algo/algo_test.go"
] | test_fail | [
"TestResultPositionsWithReusedSlab"
] | {
"src/algo/algo.go": "package algo\n\n/*\n\nAlgorithm\n---------\n\nFuzzyMatchV1 finds the first \"fuzzy\" occurrence of the pattern within the given\ntext in O(n) time where n is the length of the text. Once the position of the\nlast character is located, it traverses backwards to see if there's a shorter\nsubstrin... | {
"src/algo/algo.go": "package algo\n\n/*\n\nAlgorithm\n---------\n\nFuzzyMatchV1 finds the first \"fuzzy\" occurrence of the pattern within the given\ntext in O(n) time where n is the length of the text. Once the position of the\nlast character is located, it traverses backwards to see if there's a shorter\nsubstrin... | {
"src/algo/algo_test.go": "package algo\n\nimport (\n\t\"math\"\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/junegunn/fzf/src/util\"\n)\n\nfunc init() {\n\tInit(\"default\")\n}\n\nfunc assertMatch(t *testing.T, fun Algo, caseSensitive, forward bool, input, pattern string, sidx int, eidx int, score int... | diff --git a/src/algo/algo.go b/src/algo/algo.go
index 7748a07..2fddcab 100644
--- a/src/algo/algo.go
+++ b/src/algo/algo.go
@@ -630,6 +630,7 @@ func FuzzyMatchV2(caseSensitive bool, normalize bool, forward bool, input *util.
s2 = H[I+j0-1]
}
+ row := i
if s > s1 && (s > s2 || s == s2 && preferMatch) {... | {
"before_chars": 28250,
"patch_lines": 24
} |
kataras__iris | 23741e7209e3584b2a35da7b23577edc5cb12ad0 | a431a1c7d27679a4c086eeb89e0800b260eb404b | fix prev commit | [
"core/router"
] | [
"core/router/trie.go"
] | [
"core/router/router_wildcard_root_test.go"
] | test_fail | [
"TestPartyOnErrorCode",
"TestRouterWildcardAndStatic",
"TestRouterWildcardDifferentPrefixPath",
"TestRouterWildcardRootMany",
"TestRouterWildcardRootManyAndRootStatic"
] | {
"core/router/trie.go": "package router\n\nimport (\n\t\"strings\"\n\n\t\"github.com/kataras/iris/v12/context\"\n)\n\nconst (\n\t// ParamStart the character in string representation where the underline router starts its dynamic named parameter.\n\tParamStart = \":\"\n\t// paramStartCharacter is the character as rune... | {
"core/router/trie.go": "package router\n\nimport (\n\t\"strings\"\n\n\t\"github.com/kataras/iris/v12/context\"\n)\n\nconst (\n\t// ParamStart the character in string representation where the underline router starts its dynamic named parameter.\n\tParamStart = \":\"\n\t// paramStartCharacter is the character as rune... | {
"core/router/router_wildcard_root_test.go": "// black-box testing\n//\n// see _examples/routing/main_test.go for the most common router tests that you may want to see,\n// this is a test for the new feature that I just coded: wildcard \"/{p:path}\" on root without conflicts\n\npackage router_test\n\nimport (\n\t\"n... | diff --git a/core/router/trie.go b/core/router/trie.go
index 658e21f..0804e78 100644
--- a/core/router/trie.go
+++ b/core/router/trie.go
@@ -127,26 +127,32 @@ func (tr *trie) insert(path string, route context.RouteReadOnly, handlers contex
var paramKeys []string
- for i, s := range input {
+ for _, s := range inp... | {
"before_chars": 7252,
"patch_lines": 48
} | |
labstack__echo | df5edd9146e40342726d71cbb71300b7fea096d0 | 90702e71a7cde342da70b1f97e8e6420c509f939 | fix(rfc9457): do not mutate a shared ProblemError (#3094) | * fix(rfc9457): do not mutate a shared ProblemError | [
"."
] | [
"rfc9457.go"
] | [
"rfc9457_test.go"
] | test_fail | [
"TestProblemDetailsHTTPErrorHandler_DoesNotMutateSharedProblem"
] | {
"rfc9457.go": "// SPDX-License-Identifier: MIT\n// SPDX-FileCopyrightText: © 2015 LabStack LLC and Echo contributors\n\npackage echo\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n)\n\n// ProblemError represents a \"problem detail\" as defined in RFC 9457 (Problem Details for\n// HTTP APIs). https://www.rfc-... | {
"rfc9457.go": "// SPDX-License-Identifier: MIT\n// SPDX-FileCopyrightText: © 2015 LabStack LLC and Echo contributors\n\npackage echo\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n)\n\n// ProblemError represents a \"problem detail\" as defined in RFC 9457 (Problem Details for\n// HTTP APIs). https://www.rfc-... | {
"rfc9457_test.go": "// SPDX-License-Identifier: MIT\n// SPDX-FileCopyrightText: © 2015 LabStack LLC and Echo contributors\n\npackage echo\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\ntype customProblemE... | diff --git a/rfc9457.go b/rfc9457.go
index 90db0ac..2719b53 100644
--- a/rfc9457.go
+++ b/rfc9457.go
@@ -104,23 +104,27 @@ func ProblemDetailsHTTPErrorHandler(exposeError bool) HTTPErrorHandler {
}
}
- if pe.Status == 0 {
- pe.Status = http.StatusInternalServerError
+ // The problem can be a value the appl... | {
"before_chars": 4395,
"patch_lines": 40
} |
livekit__livekit | 6939fe3c86e5be04ec446e4e4f802f2998e3f9bf | 61ec725c5240e6b12aac1d945413995606e58038 | Fix pacer activity tracking without RTP header extensions (#4831) | [
"pkg/sfu/pacer"
] | [
"pkg/sfu/pacer/base.go"
] | [
"pkg/sfu/pacer/base_test.go"
] | test_fail | [
"TestBaseSendPacketTracksActivityWithoutHeaderExtensions"
] | {
"pkg/sfu/pacer/base.go": "// Copyright 2023 LiveKit, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless r... | {
"pkg/sfu/pacer/base.go": "// Copyright 2023 LiveKit, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless r... | {
"pkg/sfu/pacer/base_test.go": "// Copyright 2026 LiveKit, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unl... | diff --git a/pkg/sfu/pacer/base.go b/pkg/sfu/pacer/base.go
index 96e3be2..94d64d2 100644
--- a/pkg/sfu/pacer/base.go
+++ b/pkg/sfu/pacer/base.go
@@ -85,6 +85,7 @@ func (b *Base) SendPacket(p *Packet) (int, error) {
return 0, err
}
+ b.lastPacketSentAt.Store(mono.UnixNano())
return written, nil
}
@@ -103,8 +... | {
"before_chars": 3273,
"patch_lines": 30
} | |
micro__go-micro | 7c2d80a18e813987a98b5c7aa145a745418bfe08 | 7d2e9ec6ac71fc63fd81c0c370b2cbb8ba34ccec | Fix memory stream nack ordering (#4694) | Co-authored-by: Codex <codex@openai.com> | [
"events"
] | [
"events/memory.go"
] | [
"events/stream_test.go"
] | test_fail | [
"TestStream",
"TestStream/memory",
"TestStream/memory/AckingNacking"
] | {
"events/memory.go": "package events\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n\t\"github.com/pkg/errors\"\n\t\"go-micro.dev/v6/logger\"\n\t\"go-micro.dev/v6/store\"\n)\n\n// NewStream returns an initialized memory stream\nfunc NewStream(opts ...Option) (Str... | {
"events/memory.go": "package events\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n\t\"github.com/pkg/errors\"\n\t\"go-micro.dev/v6/logger\"\n\t\"go-micro.dev/v6/store\"\n)\n\n// NewStream returns an initialized memory stream\nfunc NewStream(opts ...Option) (Str... | {
"events/stream_test.go": "package events\n\nimport (\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\ntype testPayload struct {\n\tMessage string\n}\n\ntype testCase struct {\n\tstr Stream\n\tname string\n}\n\nfunc TestStream(t *testing.T) {\n\t... | diff --git a/events/memory.go b/events/memory.go
index 08d971e..bd25b13 100644
--- a/events/memory.go
+++ b/events/memory.go
@@ -36,6 +36,9 @@ type subscriber struct {
retryLimit int
autoAck bool
ackWait time.Duration
+
+ pending []Event
+ notify chan struct{}
}
type mem struct {
@@ -124,6 +127,7 @@ fu... | {
"before_chars": 5599,
"patch_lines": 165
} |
nektos__act | e374ef962fc15812c175ff9ad6c33d77b8684e05 | 2dea26ba3a258510b21a857e40643d253e024080 | fix: matrix expansion logic (#115) (#5294) | * add another test | [
"pkg/model"
] | [
"pkg/model/workflow.go"
] | [
"pkg/model/workflow_test.go"
] | test_fail | [
"TestReadWorkflow_Strategy"
] | {
"pkg/model/workflow.go": "package model\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/nektos/act/pkg/common\"\n\t\"github.com/nektos/act/pkg/schema\"\n\tlog \"github.com/sirupsen/logrus\"\n\t\"gopkg.in/yaml.v3\"\n)\n\n// Workflow is the s... | {
"pkg/model/workflow.go": "package model\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/nektos/act/pkg/common\"\n\t\"github.com/nektos/act/pkg/schema\"\n\tlog \"github.com/sirupsen/logrus\"\n\t\"gopkg.in/yaml.v3\"\n)\n\n// Workflow is the s... | {
"pkg/model/workflow_test.go": "package model\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"gopkg.in/yaml.v3\"\n)\n\nfunc TestReadWorkflow_StringEvent(t *testing.T) {\n\tyaml := `\nname: local-action-docker-url\non: push\n\njobs:... | diff --git a/pkg/model/workflow.go b/pkg/model/workflow.go
index 5802f40..cbab054 100644
--- a/pkg/model/workflow.go
+++ b/pkg/model/workflow.go
@@ -390,8 +390,6 @@ func (j *Job) Matrix() map[string][]interface{} {
// GetMatrixes returns the matrix cross product
// It skips includes and hard fails excludes for non-... | {
"before_chars": 21069,
"patch_lines": 47
} |
projectdiscovery__katana | 3978e526668e15d4158423552d51360f5727b591 | ab54d5b155c9b8541dd213f31d91ea4a28b40bb1 | fix: require label boundary for rdn scope to block look-alike domains (#1685) | * fix(scope): require label boundary for rdn scope to block look-alike domains | [
"pkg/utils/scope"
] | [
"pkg/utils/scope/scope.go"
] | [
"pkg/utils/scope/scope_test.go"
] | test_fail | [
"TestManagerValidate",
"TestManagerValidate/host",
"TestManagerValidate/host/dn",
"TestManagerValidate/host/rdn-boundary"
] | {
"pkg/utils/scope/scope.go": "package scope\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"net/url\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"golang.org/x/net/publicsuffix\"\n)\n\n// Manager manages scope for crawling process\ntype Manager struct {\n\tinScope []*regexp.Regexp\n\toutOfScope []*regexp.Regexp\n\tno... | {
"pkg/utils/scope/scope.go": "package scope\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"net/url\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"golang.org/x/net/publicsuffix\"\n)\n\n// Manager manages scope for crawling process\ntype Manager struct {\n\tinScope []*regexp.Regexp\n\toutOfScope []*regexp.Regexp\n\tno... | {
"pkg/utils/scope/scope_test.go": "package scope\n\nimport (\n\t\"testing\"\n\n\turlutil \"github.com/projectdiscovery/utils/url\"\n\t\"github.com/stretchr/testify/require\"\n)\n\n// TestManagerValidate verifies the Manager's Validate method with various scope configurations,\n// including URL pattern matching and h... | diff --git a/pkg/utils/scope/scope.go b/pkg/utils/scope/scope.go
index 61a01f8..5444ddc 100644
--- a/pkg/utils/scope/scope.go
+++ b/pkg/utils/scope/scope.go
@@ -136,13 +136,30 @@ func (m *Manager) validateDNS(hostname, rootHostname string) (bool, error) {
}
switch m.fieldScope {
case dnDnsScopeField:
- return st... | {
"before_chars": 4782,
"patch_lines": 37
} |
router-for-me__CLIProxyAPI | cb62a6748b9982c9f886e2ca9356a1c10fe14c0a | 81d6ba774621e4c05c353566db737560bfdce4e5 | fix(openai): classify stream request timeout as server error | - Consolidate stream error code and error type derivations into paired error classes | [
"sdk/api/handlers",
"test"
] | [
"sdk/api/handlers/openai_responses_stream_error.go"
] | [
"sdk/api/handlers/openai_responses_stream_error_test.go",
"test/codex_incomplete_stream_error_type_test.go"
] | test_fail | [
"TestBuildOpenAIResponsesStreamErrorChunkRequestTimeoutIsServerError",
"TestCodexIncompleteStreamIsNotTypedAsInvalidRequest"
] | {
"sdk/api/handlers/openai_responses_stream_error.go": "package handlers\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n)\n\ntype openAIResponsesStreamErrorChunk struct {\n\tType string `json:\"type\"`\n\tError map[string]any `json:\"error\"`\n\tSeq... | {
"sdk/api/handlers/openai_responses_stream_error.go": "package handlers\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n)\n\ntype openAIResponsesStreamErrorChunk struct {\n\tType string `json:\"type\"`\n\tError map[string]any `json:\"error\"`\n\tSeq... | {
"sdk/api/handlers/openai_responses_stream_error_test.go": "package handlers\n\nimport (\n\t\"encoding/json\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestBuildOpenAIResponsesStreamErrorChunk(t *testing.T) {\n\tchunk := BuildOpenAIResponsesStreamErrorChunk(http.StatusInternalServerError, \"unexpected... | diff --git a/sdk/api/handlers/openai_responses_stream_error.go b/sdk/api/handlers/openai_responses_stream_error.go
index d2951f1f..1b8fceb9 100644
--- a/sdk/api/handlers/openai_responses_stream_error.go
+++ b/sdk/api/handlers/openai_responses_stream_error.go
@@ -25,27 +25,59 @@ type openAIResponsesStreamFailedResponse ... | {
"before_chars": 6342,
"patch_lines": 96
} |
rqlite__rqlite | 3958e1a204b8f5fb255c1f402cf960db8efe0fee | c74c936db41c9abf4afa3a4342bb92b0c1d51067 | fix: add max-redirects limit to cluster Join | [
"cluster"
] | [
"cluster/client.go"
] | [
"cluster/client_test.go"
] | compile_error | [] | {
"cluster/client.go": "package cluster\n\nimport (\n\t\"compress/gzip\"\n\t\"context\"\n\t\"crypto/tls\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"os\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/rqlite/rqlite/v10/auth\"\n\t\"github.com/rqlite/rqlite/v10/cluster/proto... | {
"cluster/client.go": "package cluster\n\nimport (\n\t\"compress/gzip\"\n\t\"context\"\n\t\"crypto/tls\"\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"os\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/rqlite/rqlite/v10/auth\"\n\t\"github.com/rqlite/rqlite/v10/cluster/proto... | {
"cluster/client_test.go": "package cluster\n\nimport (\n\t\"context\"\n\t\"encoding/binary\"\n\t\"io\"\n\t\"net\"\n\t\"strings\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/rqlite/rqlite/v10/cluster/proto\"\n\t\"github.com/rqlite/rqlite/v10/cluster/servicetest\"\n\tcommand \"github.com/rqlite/rqlite/v1... | diff --git a/cluster/client.go b/cluster/client.go
index 1adca0a..1fa4809 100644
--- a/cluster/client.go
+++ b/cluster/client.go
@@ -27,6 +27,7 @@ const (
maxPoolCapacity = 64
defaultMaxRetries = 0
noRetries = 0
+ maxRedirects = 10
protoBufferLengthSize = 8
)
@@ -513,7 +514,10 @@ func (c *Clie... | {
"before_chars": 23525,
"patch_lines": 32
} | |
samber__lo | 73a8fc62551e13834585fec8162765b83eec5662 | ac3221dd22743034cde0c024a668841cff6bf33a | refactor: improve SamplesBy performance and revert non-panic behavior for negative count (#786) | Regression introduced in 1c66270 (perf: preallocate result slice in SamplesBy) where | [
".",
"it"
] | [
"find.go"
] | [
"find_test.go",
"it/find_test.go"
] | test_fail | [
"TestSamplesBy"
] | {
"find.go": "package lo\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/samber/lo/internal/constraints\"\n\t\"github.com/samber/lo/internal/xrand\"\n)\n\n// IndexOf returns the index at which the first occurrence of a value is found in a slice or -1\n// if the value cannot be found.\n// Play: https://go.dev/pla... | {
"find.go": "package lo\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/samber/lo/internal/constraints\"\n\t\"github.com/samber/lo/internal/xrand\"\n)\n\n// IndexOf returns the index at which the first occurrence of a value is found in a slice or -1\n// if the value cannot be found.\n// Play: https://go.dev/pla... | {
"find_test.go": "package lo\n\nimport (\n\t\"math/rand\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestIndexOf(t *testing.T) {\n\tt.Parallel()\n\tis := assert.New(t)\n\n\tresult1 := IndexOf([]int{0, 1, 2, 1, 2, 3}, 2)\n\tresult2 := IndexOf([]int{0, 1, 2, 1, 2, 3}, 6)\n\n\tis.... | diff --git a/find.go b/find.go
index f4be7ac..2218062 100644
--- a/find.go
+++ b/find.go
@@ -671,11 +671,7 @@ func NthOr[T any, N constraints.Integer](collection []T, nth N, fallback T) T {
// If `nth` is out of slice bounds, it returns the zero value (empty value) for that type.
// Play: https://go.dev/play/p/sHoh88... | {
"before_chars": 17604,
"patch_lines": 66
} |
schollz__croc | 129a393740d3cc9ae0ca5eb3ef9f2894ef34075c | c4e9f077775ff2db897b4a71fbba1dd6dbf358a6 | fix: codephrase | [
"src/codephrase"
] | [
"src/codephrase/codephrase.go"
] | [
"src/codephrase/codephrase_test.go"
] | test_fail | [
"TestLoadWordsAcceptsWindowsLineEndings"
] | {
"src/codephrase/codephrase.go": "// Package codephrase generates croc codes and resolves them into relay-room\n// and PAKE components.\npackage codephrase\n\nimport (\n\t\"crypto/rand\"\n\t\"crypto/sha256\"\n\t_ \"embed\"\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"strings\"\n)\n\nco... | {
"src/codephrase/codephrase.go": "// Package codephrase generates croc codes and resolves them into relay-room\n// and PAKE components.\npackage codephrase\n\nimport (\n\t\"crypto/rand\"\n\t\"crypto/sha256\"\n\t_ \"embed\"\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"strings\"\n)\n\nco... | {
"src/codephrase/codephrase_test.go": "package codephrase\n\nimport (\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\ntype zeroReader struct{}\n\nfunc (zeroReader) Read(buffer []byte) (in... | diff --git a/src/codephrase/codephrase.go b/src/codephrase/codephrase.go
index a7363e2..a7bd8a2 100644
--- a/src/codephrase/codephrase.go
+++ b/src/codephrase/codephrase.go
@@ -61,6 +61,9 @@ var (
)
func mustLoadWords(name, contents string, expected int) []string {
+ // Git may check out the embedded text with CRLF... | {
"before_chars": 6853,
"patch_lines": 14
} | |
sirupsen__logrus | d40e25cd45ed9c6b2b66e6b97573a0413e4c23bd | f9291a534cac1466d26414fd9e326381cd64ecef | fix panic in Writer | Commit 766cfece introduced this bug by defining an incorrect split | [
"."
] | [
"writer.go"
] | [
"writer_test.go"
] | compile_error | [] | {
"writer.go": "package logrus\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"runtime\"\n\t\"strings\"\n)\n\n// Writer at INFO level. See WriterLevel for details.\nfunc (logger *Logger) Writer() *io.PipeWriter {\n\treturn logger.WriterLevel(InfoLevel)\n}\n\n// WriterLevel returns an io.Writer that can be used to write arbit... | {
"writer.go": "package logrus\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"runtime\"\n\t\"strings\"\n)\n\n// Writer at INFO level. See WriterLevel for details.\nfunc (logger *Logger) Writer() *io.PipeWriter {\n\treturn logger.WriterLevel(InfoLevel)\n}\n\n// WriterLevel returns an io.Writer that can be used to write arbit... | {
"writer_test.go": "package logrus_test\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"log\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc ExampleLogger_Writer_httpServer() {\n\tlogger := logrus.New()\n\tw := logger.Writ... | diff --git a/writer.go b/writer.go
index 7e7703c..074fd4b 100644
--- a/writer.go
+++ b/writer.go
@@ -70,16 +70,16 @@ func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...
scanner.Buffer(make([]byte, bufio.MaxScanTokenSize), bufio.MaxScanTokenSize)
// Define a split function to split the... | {
"before_chars": 3174,
"patch_lines": 25
} |
slackhq__nebula | 2a1cc62001caccbbb875e03da90b671c9ac5ec16 | e753e6e93c215780aef992d0481d894f19f5b9fe | fix: guard QueryCert against panic on short/empty QNAME (#1635) | * fix: guard QueryCert against panic on short/empty QNAME | [
"."
] | [
"dns_server.go"
] | [
"dns_server_test.go"
] | test_fail | [
"TestParsequery"
] | {
"dns_server.go": "package nebula\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/netip\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"sync/atomic\"\n\n\t\"github.com/gaissmai/bart\"\n\t\"github.com/miekg/dns\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/slackhq/nebula/config\"\n)\n\ntype dnsServer... | {
"dns_server.go": "package nebula\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/netip\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"sync/atomic\"\n\n\t\"github.com/gaissmai/bart\"\n\t\"github.com/miekg/dns\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/slackhq/nebula/config\"\n)\n\ntype dnsServer... | {
"dns_server_test.go": "package nebula\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"net\"\n\t\"net/netip\"\n\t\"strconv\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/miekg/dns\"\n\t\"github.com/sirupsen/logrus\"\n\t\"github.com/slackhq/nebula/config\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/... | diff --git a/dns_server.go b/dns_server.go
index 8af88b5..5b12b92 100644
--- a/dns_server.go
+++ b/dns_server.go
@@ -241,6 +241,9 @@ func (d *dnsServer) Query(q uint16, data string) (netip.Addr, bool) {
}
func (d *dnsServer) QueryCert(data string) string {
+ if len(data) < 2 {
+ return ""
+ }
ip, err := netip.Pa... | {
"before_chars": 9807,
"patch_lines": 14
} |
stretchr__testify | ce5c2b684b39e6803c5c5e4ce8e533d20333f28d | 89920137cdfa81f0d5e6e31fd2bf8a0d1aec8e8a | assert: fix httpCode and HTTPBody occur panic when http.Handler read body | [
"assert"
] | [
"assert/http_assertions.go"
] | [
"assert/http_assertions_test.go"
] | test_fail | [
"TestHTTPSuccess"
] | {
"assert/http_assertions.go": "package assert\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"strings\"\n)\n\n// httpCode is a helper that returns HTTP code of the response. It returns -1 and\n// an error if building a new request fails.\nfunc httpCode(handler http.HandlerFunc, me... | {
"assert/http_assertions.go": "package assert\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"strings\"\n)\n\n// httpCode is a helper that returns HTTP code of the response. It returns -1 and\n// an error if building a new request fails.\nfunc httpCode(handler http.HandlerFunc, me... | {
"assert/http_assertions_test.go": "package assert\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"testing\"\n)\n\nfunc httpOK(w http.ResponseWriter, r *http.Request) {\n\tw.WriteHeader(http.StatusOK)\n}\n\nfunc httpReadBody(w http.ResponseWriter, r *http.Request) {\n\t_, _ = io.Copy(io.Discard,... | diff --git a/assert/http_assertions.go b/assert/http_assertions.go
index 6cfb6a8..8b82ca8 100644
--- a/assert/http_assertions.go
+++ b/assert/http_assertions.go
@@ -12,7 +12,7 @@ import (
// an error if building a new request fails.
func httpCode(handler http.HandlerFunc, method, url string, values url.Values) (int, ... | {
"before_chars": 5582,
"patch_lines": 22
} | |
tsenart__vegeta | 1799abc7c4eaf0795081253e90e4012b1fdc99ea | b0b14b9e9d31c2fdfca4d71972f1e5c03eaee397 | lib: fix IP selection in DNS caching | Fixes #677 | [
"lib"
] | [
"lib/attack.go"
] | [
"lib/attack_test.go"
] | compile_error | [] | {
"lib/attack.go": "package vegeta\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"math/rand\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/rs/dnscache\"\n\t\"golang.org/x/net/http2\"\n)\n\n// Attacker is an attack executor which... | {
"lib/attack.go": "package vegeta\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"math/rand\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/rs/dnscache\"\n\t\"golang.org/x/net/http2\"\n)\n\n// Attacker is an attack executor which... | {
"lib/attack_test.go": "package vegeta\n\nimport (\n\t\"bytes\"\n\t\"crypto/tls\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/googl... | diff --git a/lib/attack.go b/lib/attack.go
index 80df5e1..8467b94 100644
--- a/lib/attack.go
+++ b/lib/attack.go
@@ -375,6 +375,33 @@ func DNSCaching(ttl time.Duration) func(*Attacker) {
}
}
+// firstOfEachIPFamily returns the first IP of each IP family in the input slice.
+func firstOfEachIPFamily(ips []string) [... | {
"before_chars": 14590,
"patch_lines": 38
} |
uber-go__zap | 4892335e05f14bce8a98a69a577fcf3844a42623 | 3532124e52751881368f661fc4ba7a57dcd2bd42 | fix: validate Level before opening sinks in Config.Build (#1589) | A `zap.Config` that is missing `level` still creates the log file and | [
"."
] | [
"config.go"
] | [
"config_test.go"
] | test_fail | [
"TestConfigWithMissingLevelDoesNotOpenSinks"
] | {
"config.go": "// Copyright (c) 2016 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to... | {
"config.go": "// Copyright (c) 2016 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to... | {
"config_test.go": "// Copyright (c) 2016 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n... | diff --git a/config.go b/config.go
index e76e4e6..09a2184 100644
--- a/config.go
+++ b/config.go
@@ -242,15 +242,15 @@ func (cfg Config) Build(opts ...Option) (*Logger, error) {
return nil, err
}
+ if cfg.Level == (AtomicLevel{}) {
+ return nil, errors.New("missing Level")
+ }
+
sink, errSink, err := cfg.open... | {
"before_chars": 12237,
"patch_lines": 24
} |
urfave__cli | 254c38ea72e18e58f2ba8a4e25c7c553f19161e6 | 514a1149f005f7788b7761bb1e4d2d643a49c7dc | Fix:(issue_1293) Wrap usage text for commands (#1460) | * Fix:(issue_1293) Wrap usage text for commands | [
"."
] | [
"help.go",
"template.go"
] | [
"help_test.go"
] | test_fail | [
"TestShowAppHelp_CommandMultiLine_UsageText"
] | {
"help.go": "package cli\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\t\"text/tabwriter\"\n\t\"text/template\"\n\t\"unicode/utf8\"\n)\n\nconst (\n\thelpName = \"help\"\n\thelpAlias = \"h\"\n)\n\nvar helpCommand = &Command{\n\tName: helpName,\n\tAliases: []string{helpAlias},\n\tUsage: \"Sho... | {
"help.go": "package cli\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\t\"text/tabwriter\"\n\t\"text/template\"\n\t\"unicode/utf8\"\n)\n\nconst (\n\thelpName = \"help\"\n\thelpAlias = \"h\"\n)\n\nvar helpCommand = &Command{\n\tName: helpName,\n\tAliases: []string{helpAlias},\n\tUsage: \"Sho... | {
"help_test.go": "package cli\n\nimport (\n\t\"bytes\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"runtime\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc Test_ShowAppHelp_NoAuthor(t *testing.T) {\n\toutput := new(bytes.Buffer)\n\tapp := &App{Writer: output}\n\n\tc := NewContext(app, nil, nil)\n\n\t_... | diff --git a/help.go b/help.go
index 9a8d243..d6caea4 100644
--- a/help.go
+++ b/help.go
@@ -295,12 +295,14 @@ func printHelpCustom(out io.Writer, templ string, data interface{}, customFuncs
const maxLineLength = 10000
funcMap := template.FuncMap{
- "join": strings.Join,
- "indent": indent,
- "nindent": ni... | {
"before_chars": 15977,
"patch_lines": 91
} |
usememos__memos | 3227748a3018688d1d0b5f16aab82ae8319dc1e1 | 88f150502c9a1ec6050ff4bdd8f439f646829ab3 | fix(scheduler): correct cron calendar day matching (#6306) | [
"internal/scheduler"
] | [
"internal/scheduler/parser.go"
] | [
"internal/scheduler/parser_calendar_test.go"
] | test_fail | [
"TestScheduleNextCalendarDays",
"TestScheduleNextCalendarDays/five_fields",
"TestScheduleNextCalendarDays/five_fields/Sunday_aliases_do_not_repeat",
"TestScheduleNextCalendarDays/five_fields/Sunday_seven_in_list",
"TestScheduleNextCalendarDays/five_fields/Sunday_seven_in_range",
"TestScheduleNextCalendarD... | {
"internal/scheduler/parser.go": "package scheduler\n\nimport (\n\t\"slices\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/pkg/errors\"\n)\n\n// Schedule represents a parsed cron expression.\ntype Schedule struct {\n\tseconds fieldMatcher // 0-59 (optional, for 6-field format)\n\tminutes fieldMatche... | {
"internal/scheduler/parser.go": "package scheduler\n\nimport (\n\t\"slices\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/pkg/errors\"\n)\n\n// Schedule represents a parsed cron expression.\ntype Schedule struct {\n\tseconds fieldMatcher // 0-59 (optional, for 6-field format)\n\tminutes field... | {
"internal/scheduler/parser_calendar_test.go": "package scheduler\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestScheduleNextCalendarDays(t *testing.T) {\n\ttests := []struct {\n\t\tname string\n\t\texpr string\n\t\tfrom string\n\t\twant string\n\t}{\n\t\t{\"weekly... | diff --git a/internal/scheduler/parser.go b/internal/scheduler/parser.go
index 1619734..96a837b 100644
--- a/internal/scheduler/parser.go
+++ b/internal/scheduler/parser.go
@@ -11,13 +11,14 @@ import (
// Schedule represents a parsed cron expression.
type Schedule struct {
- seconds fieldMatcher // 0-59 (optional,... | {
"before_chars": 5673,
"patch_lines": 64
} | |
valyala__fasthttp | 0e13c85e8ed5b41b489c502eeccdf90a45eb8dfe | 8380623b0bca4b019cdfe10fae46ea6149148af1 | fix: preserve zero Max-Age when parsing cookies (#2405) | [
"."
] | [
"cookie.go"
] | [
"cookie_test.go"
] | test_fail | [
"TestCookieParseZeroMaxAge",
"TestCookieParseZeroMaxAge/case_insensitive",
"TestCookieParseZeroMaxAge/expires",
"TestCookieParseZeroMaxAge/zero",
"TestCookieParseZeroMaxAge/zero_overrides_positive"
] | {
"cookie.go": "package fasthttp\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n\t\"net/http\"\n\t\"sync\"\n\t\"time\"\n)\n\nvar zeroTime time.Time\n\nvar (\n\t// CookieExpireDelete may be set on Cookie.Expire for expiring the given cookie.\n\tCookieExpireDelete = time.Date(2009, time.November, 10, 23, 0, 0, 0, ti... | {
"cookie.go": "package fasthttp\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n\t\"net/http\"\n\t\"sync\"\n\t\"time\"\n)\n\nvar zeroTime time.Time\n\nvar (\n\t// CookieExpireDelete may be set on Cookie.Expire for expiring the given cookie.\n\tCookieExpireDelete = time.Date(2009, time.November, 10, 23, 0, 0, 0, ti... | {
"cookie_test.go": "package fasthttp\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestCookiePanic(t *testing.T) {\n\tt.Parallel()\n\n\tvar c Cookie\n\tif err := c.Parse(\";SAMeSITe=\"); err != nil {\n\t\tt.Error(err)\n\t}\n}\n\nfunc TestCookieSettersSanitizeNewLines(t *testing.T) {\n\tt.Parallel(... | diff --git a/cookie.go b/cookie.go
index b8f798a..6b22f21 100644
--- a/cookie.go
+++ b/cookie.go
@@ -414,6 +414,9 @@ func (c *Cookie) ParseBytes(src []byte) error {
if err != nil {
return err
}
+ if maxAge == 0 {
+ maxAge = -1
+ }
c.maxAge = maxAge
}
| {
"before_chars": 18366,
"patch_lines": 14
} | |
zeromicro__go-zero | 88dd61e2d8a976e8b734207f936d3953a98607ac | 35734f9f2e549d24c62e23e0e173bcec9ed06911 | fix: force refresh every call when refresh interval is 0 (#5746) | Co-authored-by: waterWang <waterWang@users.noreply.github.com> | [
"core/syncx"
] | [
"core/syncx/immutableresource.go"
] | [
"core/syncx/immutableresource_test.go"
] | test_fail | [
"TestImmutableResourceErrorRefreshWithoutClockAdvance"
] | {
"core/syncx/immutableresource.go": "package syncx\n\nimport (\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/zeromicro/go-zero/core/timex\"\n)\n\nconst defaultRefreshInterval = time.Second\n\ntype (\n\t// ImmutableResourceOption defines the method to customize an ImmutableResource.\n\tImmutableResourceOption func(resour... | {
"core/syncx/immutableresource.go": "package syncx\n\nimport (\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/zeromicro/go-zero/core/timex\"\n)\n\nconst defaultRefreshInterval = time.Second\n\ntype (\n\t// ImmutableResourceOption defines the method to customize an ImmutableResource.\n\tImmutableResourceOption func(resour... | {
"core/syncx/immutableresource_test.go": "package syncx\n\nimport (\n\t\"errors\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"testing\"\n\t\"testing/synctest\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestImmutableResource(t *testing.T) {\n\tvar count int\n\tr := NewImmutableResource(func() (any, e... | diff --git a/core/syncx/immutableresource.go b/core/syncx/immutableresource.go
index e8fa364..a0e9c3a 100644
--- a/core/syncx/immutableresource.go
+++ b/core/syncx/immutableresource.go
@@ -70,6 +70,10 @@ func (ir *ImmutableResource) Get() (any, error) {
}
func (ir *ImmutableResource) shouldRefresh() bool {
+ if ir.... | {
"before_chars": 2039,
"patch_lines": 15
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.