ernie-research/MEnvData-SWE huggingface dataset:
Repository: istio/istio (Go)

Issue:
feat(gw-inference): Shadow Service Uses Port 54320 Instead of 54321
### Is this the right place to submit this?

- [x] This is not a security vulnerability or a crashing bug
- [x] This is not a question about how to use Istio

### Bug Description

https://github.com/istio/istio/pull/57295 added support for Inference Extension v1.0.0-rc.1. As part of this change, `TargetPortNumber` changed to `TargetPorts[].Number` and `translateShadowServiceToService()` now needs to iterate through `targetPorts` of `shadowServiceInfo`. This port number is derived by adding the `dummyPort` + the `i` iterator. Since the first iterator is `0`, this will cause the shadow Service port to be `54320` instead of `54321`.

### Version

```Text
master branch
```

### Additional Information

N/A


Discussion:

Patch:
diff --git a/pilot/pkg/config/kube/gateway/inferencepool_collection.go b/pilot/pkg/config/kube/gateway/inferencepool_collection.go
index 9bebc51dddc1..3ebeb2bc055b 100644
--- a/pilot/pkg/config/kube/gateway/inferencepool_collection.go
+++ b/pilot/pkg/config/kube/gateway/inferencepool_collection.go
@@ -505,7 +505,7 @@ func InferencePoolServiceName(poolName string) (string, error) {
 func translateShadowServiceToService(existingLabels map[string]string, shadow shadowServiceInfo, extRef extRefInfo) *corev1.Service {
 	// Create the ports used by the shadow service
 	ports := make([]corev1.ServicePort, 0, len(shadow.targetPorts))
-	dummyPort := int32(54320) // Dummy port, not used for anything
+	dummyPort := int32(54321) // Dummy port, not used for anything
 	for i, port := range shadow.targetPorts {
 		ports = append(ports, corev1.ServicePort{
 			Protocol:   corev1.ProtocolTCP,
diff --git a/releasenotes/notes/57472.yaml b/releasenotes/notes/57472.yaml
new file mode 100644
index 000000000000..b2f462086b6d
--- /dev/null
+++ b/releasenotes/notes/57472.yaml
@@ -0,0 +1,10 @@
+apiVersion: release-notes/v2
+kind: feature
+area: traffic-management
+issue:
+- 57472
+
+releaseNotes:
+- |
+  **Fixed** shadow Service port number for an InferencePool to start with `54321`
+  as is did before https://github.com/istio/istio/pull/57295 merged.


Test patch:
diff --git a/pilot/pkg/config/kube/gateway/inferencepool_test.go b/pilot/pkg/config/kube/gateway/inferencepool_test.go
index 80312bed5e18..3a9ad3966a48 100644
--- a/pilot/pkg/config/kube/gateway/inferencepool_test.go
+++ b/pilot/pkg/config/kube/gateway/inferencepool_test.go
@@ -82,4 +82,5 @@ func TestReconcileInferencePool(t *testing.T) {
 	assert.Equal(t, service.ObjectMeta.Labels[InferencePoolRefLabel], pool.Name)
 	assert.Equal(t, service.OwnerReferences[0].Name, pool.Name)
 	assert.Equal(t, service.Spec.Ports[0].TargetPort.IntVal, int32(8080))
+	assert.Equal(t, service.Spec.Ports[0].Port, int32(54321)) // dummyPort + i
 }
Repository: 99designs/gqlgen (Go)

Issue:
gqlgen truncates tag value with `:`
### What happened?

We have existing schema uses tag value containing `:`. With v0.17.25 or later (PR https://github.com/99designs/gqlgen/pull/2533), the tag string is split by `:`, causing malformed value in generated model. Example:

```graphqls
  exampleField: String
    @goTag(key: "someKey", value: "path:to:example")
```

Generated:

```go
ExampleField string `someKey:"path`
```

### What did you expect?

This [line](https://github.com/99designs/gqlgen/blob/3b295bb4a70486a16e82877422a7b7c55d21f4f9/plugin/modelgen/models.go#L549) in modelgen to split by first `:` so that the entire value is kept in full form.

### Minimal graphql.schema and models to reproduce

See above.

### versions
Since v0.17.25



Discussion:

Patch:
diff --git a/plugin/modelgen/models.go b/plugin/modelgen/models.go
index bbf599d6edb..4383d76c92a 100644
--- a/plugin/modelgen/models.go
+++ b/plugin/modelgen/models.go
@@ -568,17 +568,19 @@ func removeDuplicateTags(t string) string {
 			continue
 		}
 
-		processed[kv[0]] = true
+		key := kv[0]
+		value := strings.Join(kv[1:], ":")
+		processed[key] = true
 		if len(returnTags) > 0 {
 			returnTags = " " + returnTags
 		}
 
-		isContained := containsInvalidSpace(kv[1])
+		isContained := containsInvalidSpace(value)
 		if isContained {
-			panic(fmt.Errorf("tag value should not contain any leading or trailing spaces: %s", kv[1]))
+			panic(fmt.Errorf("tag value should not contain any leading or trailing spaces: %s", value))
 		}
 
-		returnTags = kv[0] + ":" + kv[1] + returnTags
+		returnTags = key + ":" + value + returnTags
 	}
 
 	return returnTags


Test patch:
diff --git a/plugin/modelgen/models_test.go b/plugin/modelgen/models_test.go
index fa15fa010ce..8607615772e 100644
--- a/plugin/modelgen/models_test.go
+++ b/plugin/modelgen/models_test.go
@@ -534,6 +534,22 @@ func TestRemoveDuplicate(t *testing.T) {
 			want:      "gorm:\"unique;not null\" json:\"name,name2\"",
 			wantPanic: false,
 		},
+		{
+			name: "Test gorm tag with colon",
+			args: args{
+				t: "gorm:\"type:varchar(63);unique_index\"",
+			},
+			want:      "gorm:\"type:varchar(63);unique_index\"",
+			wantPanic: false,
+		},
+		{
+			name: "Test mix use of gorm and duplicate json tags with colon",
+			args: args{
+				t: "json:\"name0\" gorm:\"type:varchar(63);unique_index\" json:\"name,name2\"",
+			},
+			want:      "gorm:\"type:varchar(63);unique_index\" json:\"name,name2\"",
+			wantPanic: false,
+		},
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
Repository: cubefs/cubefs (Go)

Issue:
[Bug]: BlobStore(bytespool) returns a buffer with non-zero cap when alloc with size 0
### Contact Details

rtlinux@163.com

### Is there an existing issue for this?

- [x] I have searched all the existing issues

### Priority

low (Default)

### Environment

```markdown
- CubeFS version: master
```

### Current Behavior

reproduce:

```go
    cmp := func(size int) {
        b_make := make([]byte, size)
        log.Printf("size=%d: cap(b_make)=%d, len(b_make)=%d\n", size, cap(b_make), len(b_make))

        b_pool := bytespool.Alloc(size)
        log.Printf("size=%d: cap(b_pool)=%d, len(b_pool)=%d\n", size, cap(b_pool), len(b_pool))
    }
    cmp(0)
    cmp(1)
```

```text
2025/07/24 14:37:09 size=0: cap(b_make)=0, len(b_make)=0
2025/07/24 14:37:09 size=0: cap(b_pool)=2, len(b_pool)=0
2025/07/24 14:37:09 size=1: cap(b_make)=1, len(b_make)=1
2025/07/24 14:37:09 size=1: cap(b_pool)=1, len(b_pool)=1
```

### Expected Behavior

_No response_

### Steps To Reproduce

```markdown

```

### CubeFS Log

_No response_

### Anything else? (Additional Context)

_No response_


Discussion:

Patch:
diff --git a/blobstore/util/bytespool/pool.go b/blobstore/util/bytespool/pool.go
index d5e4d58f93..3db966dd65 100644
--- a/blobstore/util/bytespool/pool.go
+++ b/blobstore/util/bytespool/pool.go
@@ -47,7 +47,7 @@ func init() {
 // GetPool returns a sync.Pool that generates bytes slice with the size.
 // Return nil if no such pool exists.
 func GetPool(size int) *sync.Pool {
-	if size < 0 || size > maxSize {
+	if size <= 0 || size > maxSize {
 		return nil
 	}
 	bits := msb(size)


Test patch:
diff --git a/blobstore/util/bytespool/pool_test.go b/blobstore/util/bytespool/pool_test.go
index 9ff26f7d17..2e3bee7606 100644
--- a/blobstore/util/bytespool/pool_test.go
+++ b/blobstore/util/bytespool/pool_test.go
@@ -23,13 +23,13 @@ import (
 func TestUtilBytespool(t *testing.T) {
 	run := func(size int) {
 		buff := bytespool.Alloc(size)
-		if len(buff) != size {
+		if len(buff) != size || cap(buff) != size {
 			t.Fatal(size)
 		}
 		bytespool.Zero(buff)
 		bytespool.Free(buff)
 		bp := bytespool.AllocPointer(size)
-		if len(*bp) != size {
+		if len(*bp) != size || cap(*bp) != size {
 			t.Fatal(size)
 		}
 		bytespool.FreePointer(bp)
@@ -54,6 +54,7 @@ func TestUtilBytespool(t *testing.T) {
 	for bits := range [27]struct{}{} {
 		run(1 << bits)
 	}
+	bytespool.Free(nil)
 	bytespool.FreePointer(nil)
 }
Repository: go-co-op/gocron (Go)

Issue:
[BUG] - cannot handle variadic interface parameters
This code does not work:

```go
func main() {
	j, err := s.NewJob(
		gocron.DurationJob(
			10*time.Second,
		),
		gocron.NewTask(
			func(parameters ...any) {
				for i := range parameters {
					fmt.Println(parameters[i])
				}
			},
			1,
			"2",
		),
	)
	if err != nil {
		panic(err)
	}
}
```
It panicked like this: 
![image](https://github.com/user-attachments/assets/a4aa2c4c-ddb2-4f76-9380-afd449b12059)

This because the verifyVariadic only checks the first element's underlying type of `parameters ...any`, the first element's underlying type is `int` here and the second element's underlying type is `string`.

What I want: This code runs well without any panicking and keeps type-safe.

The correct behavior is that if the variadic parameter's type is interface, we only need to check if the actual parameters implement that interface.

I'd like to send a PR to fix this issue.



Discussion:
Thank you for reporting and fixing!



Patch:
diff --git a/scheduler.go b/scheduler.go
index ad2f8db7..a9e0fc5a 100644
--- a/scheduler.go
+++ b/scheduler.go
@@ -535,12 +535,25 @@ func (s *scheduler) NewJob(jobDefinition JobDefinition, task Task, options ...Jo
 	return s.addOrUpdateJob(uuid.Nil, jobDefinition, task, options)
 }
 
+func (s *scheduler) verifyInterfaceVariadic(taskFunc reflect.Value, tsk task, variadicStart int) error {
+	ifaceType := taskFunc.Type().In(variadicStart).Elem()
+	for i := variadicStart; i < len(tsk.parameters); i++ {
+		if !reflect.TypeOf(tsk.parameters[i]).Implements(ifaceType) {
+			return ErrNewJobWrongTypeOfParameters
+		}
+	}
+	return nil
+}
+
 func (s *scheduler) verifyVariadic(taskFunc reflect.Value, tsk task, variadicStart int) error {
 	if err := s.verifyNonVariadic(taskFunc, tsk, variadicStart); err != nil {
 		return err
 	}
 	parameterType := taskFunc.Type().In(variadicStart).Elem().Kind()
-	if parameterType == reflect.Interface || parameterType == reflect.Pointer {
+	if parameterType == reflect.Interface {
+		return s.verifyInterfaceVariadic(taskFunc, tsk, variadicStart)
+	}
+	if parameterType == reflect.Pointer {
 		parameterType = reflect.Indirect(reflect.ValueOf(taskFunc.Type().In(variadicStart))).Kind()
 	}
 


Test patch:
diff --git a/scheduler_test.go b/scheduler_test.go
index 52fb8e2f..e55b47b7 100644
--- a/scheduler_test.go
+++ b/scheduler_test.go
@@ -4,6 +4,7 @@ import (
 	"context"
 	"errors"
 	"fmt"
+	"io"
 	"os"
 	"sync"
 	"sync/atomic"
@@ -924,6 +925,16 @@ func TestScheduler_NewJobTask(t *testing.T) {
 			NewTask(func(args ...interface{}) {}),
 			nil,
 		},
+		{
+			"all good - interface variadic, int, string",
+			NewTask(func(args ...interface{}) {}, 1, "2", 3.0),
+			nil,
+		},
+		{
+			"parameter type does not match - different argument types against interface variadic parameters",
+			NewTask(func(args ...io.Reader) {}, os.Stdout, any(3.0)),
+			ErrNewJobWrongTypeOfParameters,
+		},
 	}
 
 	for _, tt := range tests {
Repository: helmfile/helmfile (Go)

Issue:
incorrect warning printed: environments and releases cannot be defined within the same YAML part...
### Operating system

MacOS Sonoma 14.6.1

### Helmfile Version

v0.168.0

### Helm Version

v3.16.1

### Bug description

The following warning:
```
WARNING: environments and releases cannot be defined within the same YAML part. Use --- to extract the environments into a dedicated part
```
is improperly displayed when an inlined value contains a nested `releases:` tag.

### Example helmfile.yaml
```
---
environments:
  local:
    values:
      - foo:
          bar:
            releases:
---
releases:
  - chart: chart/foobar
```

### Error message you've seen (if any)

```
❯ helmfile --file helmfile.yaml list
WARNING: environments and releases cannot be defined within the same YAML part. Use --- to extract the environments into a dedicated part
NAME	NAMESPACE	ENABLED	INSTALLED	LABELS	CHART       	VERSION
    	         	true   	true     	      	chart/foobar	       
```

### Steps to reproduce

Run simple snippet provided

### Working Helmfile Version

unknown

### Relevant discussion

_No response_


Discussion:
https://github.com/helmfile/helmfile/pull/1654



Patch:
diff --git a/pkg/policy/checker.go b/pkg/policy/checker.go
index eea0a0cde..b493d5133 100644
--- a/pkg/policy/checker.go
+++ b/pkg/policy/checker.go
@@ -8,6 +8,7 @@ import (
 	"regexp"
 	"slices"
 	"strings"
+	"unicode"
 
 	"github.com/helmfile/helmfile/pkg/runtime"
 )
@@ -83,13 +84,15 @@ func TopKeys(helmfileContent []byte, hasSeparator bool) []string {
 	clines := bytes.Split(helmfileContent, []byte("\n"))
 
 	for _, line := range clines {
-		lineStr := strings.TrimSpace(string(line))
+		lineStr := strings.TrimRightFunc(string(line), unicode.IsSpace)
 		if lineStr == "" {
 			continue // Skip empty lines
 		}
 		if hasSeparator && separatorRegex.MatchString(lineStr) {
 			topKeys = append(topKeys, lineStr)
-		} else if topConfigKeysRegex.MatchString(lineStr) {
+		}
+
+		if topConfigKeysRegex.MatchString(lineStr) {
 			topKey := strings.SplitN(lineStr, ":", 2)[0]
 			topKeys = append(topKeys, topKey)
 		}


Test patch:
diff --git a/pkg/policy/checker_test.go b/pkg/policy/checker_test.go
index b867b4ade..7c28555c7 100644
--- a/pkg/policy/checker_test.go
+++ b/pkg/policy/checker_test.go
@@ -230,6 +230,11 @@ func TestTopKeys(t *testing.T) {
 			helmfileContent: []byte(""),
 			want:            nil,
 		},
+		{
+			name:            "sub level contains top level key",
+			helmfileContent: []byte("bases:\n  releases:\n    - name: test\n      namespace: test\n"),
+			want:            []string{"bases"},
+		},
 	}
 
 	for _, tt := range tests {
Repository: google/go-github (Go)

Issue:
The Copilot Seat Billing API response for the assignee type can be "null"
There is a bug in the copilot seat details, per the spec null is a valid response type for the assignee:

```json
          "assignee": {
            "anyOf": [
              {
                "type": "null"
              },
```

https://docs.github.com/en/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-organization

However, the code here errors with 
Code:
https://github.com/google/go-github/blob/eff2bbd83e04dfdb38a9a878f7756e305656a9e2/github/copilot.go#L47

https://github.com/google/go-github/blob/eff2bbd83e04dfdb38a9a878f7756e305656a9e2/github/copilot.go#L212

 it's getting tested here and expecting an error, as invalid json. 
This test checks for nil type, and returns an error, it should pass. 
https://github.com/google/go-github/blob/eff2bbd83e04dfdb38a9a878f7756e305656a9e2/github/copilot_test.go#L30



Discussion:
Thank you, @beryl-factset! Would you like to create a PR to fix this, or shall I open it up to our other amazing contributors to fix?
Please open it up! I have not had a chance to create a PR for it. 
This has been resolved via #3619 , which has now been merged. Thank you!




Patch:
diff --git a/github/copilot.go b/github/copilot.go
index bed83536b41..b4f21ad39aa 100644
--- a/github/copilot.go
+++ b/github/copilot.go
@@ -203,6 +203,11 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error {
 	cp.PlanType = seatDetail.PlanType
 
 	switch v := seatDetail.Assignee.(type) {
+	case nil:
+		// Assignee can be null according to GitHub API specification.
+		// See: https://docs.github.com/en/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-organization
+		// Note: Copilot API is in public preview and subject to change.
+		cp.Assignee = nil
 	case map[string]any:
 		jsonData, err := json.Marshal(seatDetail.Assignee)
 		if err != nil {


Test patch:
diff --git a/github/copilot_test.go b/github/copilot_test.go
index ed81761370e..1aeb4308555 100644
--- a/github/copilot_test.go
+++ b/github/copilot_test.go
@@ -58,6 +58,16 @@ func TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) {
 			want:    &CopilotSeatDetails{},
 			wantErr: true,
 		},
+		{
+			name: "Null Assignee",
+			data: `{
+					"assignee": null
+				}`,
+			want: &CopilotSeatDetails{
+				Assignee: nil,
+			},
+			wantErr: false,
+		},
 		{
 			name: "Invalid Assignee Field Type",
 			data: `{
Repository: qax-os/excelize (Go)

Issue:
The positiveHandler method returns an incorrect value

**Description**
当单元格内容为手机号时且单元格式为常规类型，此时被粗暴的转为浮点类型，造成结果不正确。  
例如`13812349876`结果将会变成`1.381234988E+10`。  
此bug由`2024/3/19 8:58:52`提交所生产的，相关提交id[9e884c798be12fc1b2b985ed2db7f09f765f990a](https://github.com/qax-os/excelize/commit/9e884c798be12fc1b2b985ed2db7f09f765f990a)，如下图：

 
![image](https://github.com/user-attachments/assets/187163ab-31c7-4d84-92e5-42cae20507e9)




Discussion:
Thanks for your issue. Could you show us a complete, standalone example program or reproducible demo? If you open an existing workbook, please provide the file attachment without confidential info.
ok!
[sample.xlsx](https://github.com/user-attachments/files/16827649/sample.xlsx)

Thanks for your feedback. This issue has been fixed, please upgrade to the master branch code by `go get -u github.com/xuri/excelize/v2@master`.



Patch:
diff --git a/numfmt.go b/numfmt.go
index cae88d64ab..265fe28379 100644
--- a/numfmt.go
+++ b/numfmt.go
@@ -5136,7 +5136,10 @@ func (nf *numberFormat) positiveHandler() string {
 	var fmtNum bool
 	for _, token := range nf.section[nf.sectionIdx].Items {
 		if token.TType == nfp.TokenTypeGeneral {
-			return strconv.FormatFloat(nf.number, 'G', 10, 64)
+			if isNum, precision, _ := isNumeric(nf.value); isNum && precision > 11 {
+				return strconv.FormatFloat(nf.number, 'G', 10, 64)
+			}
+			return nf.value
 		}
 		if inStrSlice(supportedNumberTokenTypes, token.TType, true) != -1 {
 			fmtNum = true


Test patch:
diff --git a/numfmt_test.go b/numfmt_test.go
index 61bf41bb48..c3e1a9928b 100644
--- a/numfmt_test.go
+++ b/numfmt_test.go
@@ -11,6 +11,7 @@ func TestNumFmt(t *testing.T) {
 	for _, item := range [][]string{
 		{"123", "general", "123"},
 		{"-123", ";general", "-123"},
+		{"12345678901", "General", "12345678901"},
 		{"43543.5448726851", "General", "43543.54487"},
 		{"-43543.5448726851", "General", "-43543.54487"},
 		{"1234567890.12345", "General", "1234567890"},
Repository: knative/eventing (Go)

Issue:
Broker filter should return retrable error in case the subscriber URI is empty
Currently, we are returning _400 Bad Request_ here:

https://github.com/knative/eventing/blob/facf1df407babbced7866fdde830ba7cd63269ce/pkg/broker/filter/filter_handler.go#L425-L431

That error is non-retryable according to the table: https://github.com/knative/specs/blob/main/specs/eventing/data-plane.md#event-acknowledgement-and-delivery-retry

The subscriber URI might have been briefly nil, for example, sometimes during the graceful shutdown, and if so, we shouldn't return _400 Bad Request_, but something that could be retried. In this exact situation, the _404 Endpoint does not exist_ seams to have the most sense.

This could lead to data loss, so it should be resolved as a priority.

/kind bug
/priority important-soon


Discussion:

Patch:
diff --git a/pkg/broker/filter/filter_handler.go b/pkg/broker/filter/filter_handler.go
index 67640faadcc..e8d8c9ecf2c 100644
--- a/pkg/broker/filter/filter_handler.go
+++ b/pkg/broker/filter/filter_handler.go
@@ -425,8 +425,8 @@ func (h *Handler) handleDispatchToSubscriberRequest(ctx context.Context, trigger
 	subscriberURI := trigger.Status.SubscriberURI
 	if subscriberURI == nil {
 		// Record the event count.
-		writer.WriteHeader(http.StatusBadRequest)
-		_ = h.reporter.ReportEventCount(reportArgs, http.StatusBadRequest)
+		writer.WriteHeader(http.StatusNotFound)
+		_ = h.reporter.ReportEventCount(reportArgs, http.StatusNotFound)
 		return
 	}
 


Test patch:
diff --git a/pkg/broker/filter/filter_handler_test.go b/pkg/broker/filter/filter_handler_test.go
index a1a290524ca..aea2cf0f6cc 100644
--- a/pkg/broker/filter/filter_handler_test.go
+++ b/pkg/broker/filter/filter_handler_test.go
@@ -138,7 +138,7 @@ func TestReceiver(t *testing.T) {
 			triggers: []*eventingv1.Trigger{
 				makeTrigger(withoutSubscriberURI()),
 			},
-			expectedStatus:     http.StatusBadRequest,
+			expectedStatus:     http.StatusNotFound,
 			expectedEventCount: true,
 		},
 		"Trigger without a Filter": {
Repository: terrastruct/d2 (Go)

Issue:
Formatting `X${a})` behaves unexpectedly
To reproduce, format with v0.6.9:
```
vars: {
  a: "a"
  b: "X${a})"
}
```

Expected: same as input.

Actual:
```
vars: {
  a: "a"
  b: "X${a}X)"
}
```



Discussion:

Patch:
diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md
index 282993cdc4..442b2fe741 100644
--- a/ci/release/changelogs/next.md
+++ b/ci/release/changelogs/next.md
@@ -28,6 +28,8 @@
   - fixes inconsistencies when objects were double quoted [#2390](https://github.com/terrastruct/d2/pull/2390)
   - fixes globs not applying to spread substitutions [#2426](https://github.com/terrastruct/d2/issues/2426)
   - fixes panic when classes were mixed with layers incorrectly [#2448](https://github.com/terrastruct/d2/pull/2448)
+- Formatter:
+  - fixes substitutions in quotes surrounded by text [#2462](https://github.com/terrastruct/d2/pull/2462)
 - CLI: fetch and render remote images of mimetype octet-stream correctly [#2370](https://github.com/terrastruct/d2/pull/2370)
 - Composition: spread importing scenarios/steps was not inheriting correctly [#2460](https://github.com/terrastruct/d2/pull/2460)
 - Markdown: fixes nested var substitutions not working [#2456](https://github.com/terrastruct/d2/pull/2456)
diff --git a/d2format/format.go b/d2format/format.go
index a2acb4b6b5..63bebcaddf 100644
--- a/d2format/format.go
+++ b/d2format/format.go
@@ -127,7 +127,7 @@ func (p *printer) blockComment(bc *d2ast.BlockComment) {
 }
 
 func (p *printer) interpolationBoxes(boxes []d2ast.InterpolationBox, isDoubleString bool) {
-	for _, b := range boxes {
+	for i, b := range boxes {
 		if b.Substitution != nil {
 			p.substitution(b.Substitution)
 			continue
@@ -140,6 +140,11 @@ func (p *printer) interpolationBoxes(boxes []d2ast.InterpolationBox, isDoubleStr
 				s = escapeUnquotedValue(*b.String, p.inKey)
 			}
 			b.StringRaw = &s
+		} else if i > 0 && boxes[i-1].Substitution != nil {
+			// If this string follows a substitution, we need to make sure to use
+			// the actual string content, not the raw value which might be incorrect
+			s := *b.String
+			b.StringRaw = &s
 		}
 		if !isDoubleString {
 			if _, ok := d2ast.ReservedKeywords[strings.ToLower(*b.StringRaw)]; ok {


Test patch:
diff --git a/d2format/format_test.go b/d2format/format_test.go
index ab90ea276d..ed7c9e97a8 100644
--- a/d2format/format_test.go
+++ b/d2format/format_test.go
@@ -892,6 +892,19 @@ scenarios: {}
 steps: asdf
 `,
 			exp: `k
+`,
+		},
+		{
+			name: "vars",
+			in: `vars: {
+  a: "a"
+  b: "X${a})"
+}
+`,
+			exp: `vars: {
+  a: "a"
+  b: "X${a})"
+}
 `,
 		},
 	}
Repository: vitessio/vitess (Go)

Issue:
evalengine bug: bad compilation: stack pointer at X after compilation
When comparing expressions of different widths, the evalengine compiler fails with:

`bad compilation: stack pointer at 3 after compilation (expr: :e_id = id)`

Here is a unit test that shows the problem.

```go
func TestBindVarType(t *testing.T) {
	lhs := sqlparser.NewTypedArgument("lhs", sqltypes.Int32)
	rhs := sqlparser.NewTypedArgument("rhs", sqltypes.Int64)
	venv := vtenv.NewTestEnv()
	cmp := &sqlparser.ComparisonExpr{
		Operator: sqlparser.EqualOp,
		Left:     lhs,
		Right:    rhs,
	}
	_, err := Translate(cmp, &Config{
		Collation:   venv.CollationEnv().DefaultConnectionCharset(),
		Environment: venv,
	})
	require.NoError(t, err)
}
```


Discussion:

Patch:
diff --git a/go/vt/vtgate/evalengine/expr_bvar.go b/go/vt/vtgate/evalengine/expr_bvar.go
index 23b40949e83..f48ec037ac8 100644
--- a/go/vt/vtgate/evalengine/expr_bvar.go
+++ b/go/vt/vtgate/evalengine/expr_bvar.go
@@ -125,10 +125,13 @@ func (bvar *BindVariable) compile(c *compiler) (ctype, error) {
 
 	switch tt := typ.Type; {
 	case sqltypes.IsSigned(tt):
+		typ.Type = sqltypes.Int64
 		c.asm.PushBVar_i(bvar.Key)
 	case sqltypes.IsUnsigned(tt):
+		typ.Type = sqltypes.Uint64
 		c.asm.PushBVar_u(bvar.Key)
 	case sqltypes.IsFloat(tt):
+		typ.Type = sqltypes.Float64
 		c.asm.PushBVar_f(bvar.Key)
 	case sqltypes.IsDecimal(tt):
 		c.asm.PushBVar_d(bvar.Key)
@@ -146,9 +149,11 @@ func (bvar *BindVariable) compile(c *compiler) (ctype, error) {
 			typ.Type = sqltypes.VarBinary
 			typ.Flag |= flagBit
 		} else {
+			typ.Type = sqltypes.VarChar
 			c.asm.PushBVar_text(bvar.Key, typ.Col)
 		}
 	case sqltypes.IsBinary(tt):
+		typ.Type = sqltypes.VarBinary
 		c.asm.PushBVar_bin(bvar.Key)
 	case sqltypes.IsNull(tt):
 		c.asm.PushNull()


Test patch:
diff --git a/go/vt/vtgate/evalengine/translate_test.go b/go/vt/vtgate/evalengine/translate_test.go
index 715b773398a..c0478b7af03 100644
--- a/go/vt/vtgate/evalengine/translate_test.go
+++ b/go/vt/vtgate/evalengine/translate_test.go
@@ -452,3 +452,19 @@ func TestCardinalityWithBindVariables(t *testing.T) {
 		})
 	}
 }
+
+func TestBindVarType(t *testing.T) {
+	lhs := sqlparser.NewTypedArgument("lhs", sqltypes.Int32)
+	rhs := sqlparser.NewTypedArgument("rhs", sqltypes.Int64)
+	venv := vtenv.NewTestEnv()
+	cmp := &sqlparser.ComparisonExpr{
+		Operator: sqlparser.EqualOp,
+		Left:     lhs,
+		Right:    rhs,
+	}
+	_, err := Translate(cmp, &Config{
+		Collation:   venv.CollationEnv().DefaultConnectionCharset(),
+		Environment: venv,
+	})
+	require.NoError(t, err)
+}
Repository: vitessio/vitess (Go)

Issue:
Bug Report: `schemadiff` does not recognize change as INSTANT-able when `ALGORITHM=INSTANT` defined
### Overview of the Issue

`schemadiff` provides schema/change analysis, and can predict whether a certain `ALTER TABLE` statement is eligible for `INSTANT` DDL.

However, the following is actually not recognized as INSTANT-able:
```sql
alter table t1 add column i2 int, algorithm=instant
```
because `algorithm` option is itself not getting analyzed. This is counter intuitive.

`alterOptionCapableOfInstantDDL`, as part of `AlterTableCapableOfInstantDDL`, should recognize that `ALGORITHM=INSTANT` does not in itself invalidate the `INSTANT`-capability.

### Reproduction Steps

-

### Binary Version

```sh
current, 21
```

### Operating System and Environment details

```sh
-
```

### Log Fragments

```sh

```


Discussion:

Patch:
diff --git a/go/vt/schemadiff/capability.go b/go/vt/schemadiff/capability.go
index 9a4010854d7..5a946888f6a 100644
--- a/go/vt/schemadiff/capability.go
+++ b/go/vt/schemadiff/capability.go
@@ -223,6 +223,9 @@ func alterOptionCapableOfInstantDDL(alterOption sqlparser.AlterOption, createTab
 			return capableOf(capabilities.InstantChangeColumnVisibilityCapability)
 		}
 		return false, nil
+	case sqlparser.AlgorithmValue:
+		// We accept an explicit ALGORITHM=INSTANT option.
+		return strings.EqualFold(string(opt), sqlparser.InstantStr), nil
 	default:
 		return false, nil
 	}


Test patch:
diff --git a/go/vt/schemadiff/capability_test.go b/go/vt/schemadiff/capability_test.go
index ad9e0507e5a..fcbfab6c163 100644
--- a/go/vt/schemadiff/capability_test.go
+++ b/go/vt/schemadiff/capability_test.go
@@ -345,6 +345,24 @@ func TestAlterTableCapableOfInstantDDL(t *testing.T) {
 			alter:                     "alter table t1 alter column i1 drop default",
 			expectCapableOfInstantDDL: true,
 		},
+		{
+			name:                      "add column with explicit ALGORITHM=instant",
+			create:                    "create table t1 (id int, i1 int)",
+			alter:                     "alter table t1 add column i2 int, algorithm=instant",
+			expectCapableOfInstantDDL: true,
+		},
+		{
+			name:                      "add column with explicit ALGORITHM=INSTANT",
+			create:                    "create table t1 (id int, i1 int)",
+			alter:                     "alter table t1 add column i2 int, algorithm=INSTANT",
+			expectCapableOfInstantDDL: true,
+		},
+		{
+			name:                      "reject if ALGORITHM=COPY",
+			create:                    "create table t1 (id int, i1 int)",
+			alter:                     "alter table t1 add column i2 int, algorithm=COPY",
+			expectCapableOfInstantDDL: false,
+		},
 	}
 	for _, tcase := range tcases {
 		t.Run(tcase.name, func(t *testing.T) {
Repository: 99designs/aws-vault (Go)

Issue:
Web identity + role fails to validate in the 7.0.0 release
- [X] I am using the latest release of AWS Vault
- [X] I have provided my `.aws/config` (redacted if necessary)
- [ ] I have provided the debug output using `aws-vault --debug` (redacted if necessary)

After upgrading to 7.0.0, we're seeing errors:

```
aws-vault: error: exec: Error getting temporary credentials: profile 'XXXX' has more than one source of credentials
```

This appears to be related to some new validation code(https://github.com/99designs/aws-vault/blob/ec5e53c91b9990c39c0af69de45f21e436abaa23/vault/config.go#L684-L709), which counts both a `role` and a `web_identity_token_process` as two independent sources. However, the web identity provider _requires_ both of these to be set: https://github.com/99designs/aws-vault/pull/587#issue-616928047

I'm not sure what the motivation with the new validation check was, but I'm guessing we need to only increment the count when a role exists when the web identity file/process is not set.


Discussion:

Patch:
diff --git a/vault/config.go b/vault/config.go
index bc8c6eca4..f769b772d 100644
--- a/vault/config.go
+++ b/vault/config.go
@@ -698,7 +698,12 @@ func (c *ProfileConfig) Validate() error {
 	}
 	if c.HasSourceProfile() {
 		n++
-	} else if c.HasRole() {
+	}
+	if c.HasRole() &&
+		// these cases require the role to be set in addition, so it's part of
+		// their credential.
+		!c.HasSourceProfile() &&
+		!c.HasWebIdentity() {
 		n++
 	}
 	if n > 1 {


Test patch:
diff --git a/vault/config_test.go b/vault/config_test.go
index 3e3644ab0..c69c116db 100644
--- a/vault/config_test.go
+++ b/vault/config_test.go
@@ -635,6 +635,10 @@ source_profile = foo
 region         = eu-west-2
 mfa_serial     = arn:aws:iam::9999999999999:mfa/david
 credential_process = true
+
+[profile withwebidentity]
+role_arn = arn:aws:iam::123457890:role/foo
+web_identity_token_process = oidccli -issuer=https://example.com -client-id=aws -client-secret=localonly raw
 `))
 	defer os.Remove(f)
 	configFile, _ := vault.LoadConfig(f)
@@ -651,4 +655,10 @@ credential_process = true
 	if err == nil {
 		t.Fatalf("Should have failed validation: %v", err)
 	}
+
+	config, _ = configLoader.GetProfileConfig("withwebidentity")
+	err = config.Validate()
+	if err != nil {
+		t.Fatalf("Should have validated withwebidentity: %v", err)
+	}
 }
Repository: pulumi/pulumi (Go)

Issue:
`whoami` is missing a newline
There is no newline at the end of `pulumi whoami`'s output:

![image](https://github.com/pulumi/pulumi/assets/3953235/f97f0ab1-8c73-4c53-80bc-fc0c77fb2121)



Discussion:
I'd always assumed this had been done on purpose to make it easy to interpolate into shell variables? 
UNIX `whoami` puts a newline at the end, and is commonly used this way?

![image](https://github.com/pulumi/pulumi/assets/3953235/54ff7d5e-53a4-4bbf-be62-5acea62878cd)

Looks like we used to print the newline, but that changed with https://github.com/pulumi/pulumi/issues/14008
Fix: https://github.com/pulumi/pulumi/pull/14025



Patch:
diff --git a/changelog/pending/20230923--cli--include-a-newline-in-pulumi-whoami-s-output.yaml b/changelog/pending/20230923--cli--include-a-newline-in-pulumi-whoami-s-output.yaml
new file mode 100644
index 000000000000..036bb95dbc7f
--- /dev/null
+++ b/changelog/pending/20230923--cli--include-a-newline-in-pulumi-whoami-s-output.yaml
@@ -0,0 +1,4 @@
+changes:
+- type: fix
+  scope: cli
+  description: Include a newline in `pulumi whoami`'s output
diff --git a/pkg/cmd/pulumi/whoami.go b/pkg/cmd/pulumi/whoami.go
index 940802809a30..7cc4f39b79d2 100644
--- a/pkg/cmd/pulumi/whoami.go
+++ b/pkg/cmd/pulumi/whoami.go
@@ -107,7 +107,7 @@ func (cmd *whoAmICmd) Run(ctx context.Context) error {
 		fmt.Fprintf(cmd.Stdout, "Organizations: %s\n", strings.Join(orgs, ", "))
 		fmt.Fprintf(cmd.Stdout, "Backend URL: %s\n", b.URL())
 	} else {
-		fmt.Fprint(cmd.Stdout, name)
+		fmt.Fprintf(cmd.Stdout, "%s\n", name)
 	}
 
 	return nil


Test patch:
diff --git a/pkg/cmd/pulumi/whoami_test.go b/pkg/cmd/pulumi/whoami_test.go
index 59d78b637592..19a8e9b51e9b 100644
--- a/pkg/cmd/pulumi/whoami_test.go
+++ b/pkg/cmd/pulumi/whoami_test.go
@@ -30,7 +30,7 @@ func TestWhoAmICmd_default(t *testing.T) {
 	err := cmd.Run(context.Background())
 	require.NoError(t, err)
 
-	assert.Equal(t, "user1", buff.String())
+	assert.Equal(t, "user1\n", buff.String())
 }
 
 func TestWhoAmICmd_verbose(t *testing.T) {
Repository: libp2p/go-libp2p (Go)

Issue:
calling `Connect` to a peerID not in the peerstore panics
a call is made to `Connect` on a [routed host](https://github.com/libp2p/go-libp2p/blob/master/p2p/host/routed/routed.go#L48). In this case within the boost / filecoin system.

In some cases the peer being connected to may not have addresses.

Expected behavior: Error that the connection cannot be made.
Actual behavior: `panic: runtime error: index out of range [-1]`

Stack:
```
goroutine 764909 [running]:
github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem.(*addrSegments).get(...)
	~github.com/libp2p/go-libp2p@v0.23.2/p2p/host/peerstore/pstoremem/addr_book.go:49
github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem.(*memoryAddrBook).Addrs(0x0?, {0x0?, 0x10994b000?})
	~github.com/libp2p/go-libp2p@v0.23.2/p2p/host/peerstore/pstoremem/addr_book.go:327 +0x164
github.com/libp2p/go-libp2p/p2p/host/routed.(*RoutedHost).Connect(0x140003e8e20, {0x108676ac0, 0x1400073fc80}, {{0x0, 0x0}, {0x0, 0x0, 0x0}})
	~github.com/libp2p/go-libp2p@v0.23.2/p2p/host/routed/routed.go:63 +0x150
```


Discussion:
That can only happen when the peer ID is empty, right?
https://github.com/libp2p/go-libp2p/blob/5b5eea45d3ce8d265742d18578824ec857c07533/p2p/host/peerstore/pstoremem/addr_book.go#L48-L50
good catch - it looks like this is a degenerate case when being asked to connect to `peer.AddrInfo{}`.

We definitely shouldn't panic here, but I'd suspect there's also a bug in your code somewhere if you're asking us to connect to an empty peer ID.



Patch:
diff --git a/p2p/host/peerstore/pstoremem/addr_book.go b/p2p/host/peerstore/pstoremem/addr_book.go
index 28aa6d4d3c..fc4fd0675a 100644
--- a/p2p/host/peerstore/pstoremem/addr_book.go
+++ b/p2p/host/peerstore/pstoremem/addr_book.go
@@ -46,7 +46,10 @@ type addrSegment struct {
 }
 
 func (segments *addrSegments) get(p peer.ID) *addrSegment {
-	return segments[byte(p[len(p)-1])]
+	if len(p) == 0 { // it's not terribly useful to use an empty peer ID, but at least we should not panic
+		return segments[0]
+	}
+	return segments[uint8(p[len(p)-1])]
 }
 
 type clock interface {


Test patch:
diff --git a/p2p/host/peerstore/test/addr_book_suite.go b/p2p/host/peerstore/test/addr_book_suite.go
index dba2b3cd84..62327e318a 100644
--- a/p2p/host/peerstore/test/addr_book_suite.go
+++ b/p2p/host/peerstore/test/addr_book_suite.go
@@ -135,6 +135,12 @@ func testAddAddress(ab pstore.AddrBook, clk *mockClock.Mock) func(*testing.T) {
 			ab.UpdateAddrs(id, 4*time.Second, 0)
 			AssertAddressesEqual(t, nil, ab.Addrs(id))
 		})
+
+		t.Run("accessing an empty peer ID", func(t *testing.T) {
+			addrs := GenerateAddrs(5)
+			ab.AddAddrs("", addrs, time.Hour)
+			AssertAddressesEqual(t, addrs, ab.Addrs(""))
+		})
 	}
 }
Repository: getkin/kin-openapi (Go)

Issue:
Caching of compiled regexes doesn't work in openapi3 schema validation
[Here](https://github.com/getkin/kin-openapi/blob/90fb6412a4b6efaf42cc479a53c9f048d4d30144/openapi3/schema_pattern.go#L33) in the openapi 3 code it tries to cache a compiled regex in a sync map with a CompareAndSwap call, attempting to insert the new compiled regex in the map if the previous entry was nil.

Unfortunately this will never work as this call will only swap with an existing entry. If there is no existing entry for the key CompareAndSwap will not make a swap.

It is simple to fix the problem by replacing the CompareAndSwap call with a Store call. In my testing this halved the time take for validation of our schema, and reduced the allocations from 1133 per validation to 361.

I'm happy to provide a PR for this problem if desired.


Discussion:
Thanks!



Patch:
diff --git a/openapi3/schema_pattern.go b/openapi3/schema_pattern.go
index 58197137..2010d57c 100644
--- a/openapi3/schema_pattern.go
+++ b/openapi3/schema_pattern.go
@@ -30,6 +30,6 @@ func (schema *Schema) compilePattern(c RegexCompilerFunc) (cp RegexMatcher, err
 		return
 	}
 
-	var _ bool = compiledPatterns.CompareAndSwap(pattern, nil, cp)
+	compiledPatterns.Store(pattern, cp)
 	return
 }


Test patch:
diff --git a/openapi3/schema_pattern_test.go b/openapi3/schema_pattern_test.go
index fd4c94b6..988adfa4 100644
--- a/openapi3/schema_pattern_test.go
+++ b/openapi3/schema_pattern_test.go
@@ -17,3 +17,17 @@ func TestPattern(t *testing.T) {
 	require.Equal(t, `^[a-zA-Z\x{0080}-\x{024F}]+$`, intoGoRegexp(`^[a-zA-Z\u0080-\u024F]+$`))
 	require.Equal(t, `^[6789a-zA-Z\x{0080}-\x{024F}]+$`, intoGoRegexp(`^[6789a-zA-Z\u0080-\u024F]+$`))
 }
+
+func TestSchemaPatternCache(t *testing.T) {
+	var schema Schema
+
+	schema.Pattern = `^[a-zA-Z\x{0080}-\x{024F}]+$`
+	cp, err := schema.compilePattern(nil)
+	require.NoError(t, err)
+	require.NotNil(t, cp)
+
+	// The compiled pattern should be cached
+	v, ok := compiledPatterns.Load(schema.Pattern)
+	require.True(t, ok)
+	require.Equal(t, cp, v)
+}
Repository: gofiber/fiber (Go)

Issue:
🐛 [Bug]: requestId middleware still only accepts `string` for `ContextKey` config value, should be `any` like `c.Locals`.
### Bug Description

#2143 allows to use `any` as key for `c.Locals(key, v)`. The RequestID middleware should be consistent with that.
This allows to use a custom type for context keys, like for other keys. The RequestID is likely read back somewhere else along other context keys.

### How to Reproduce

See https://docs.gofiber.io/api/middleware/requestid#config

### Expected Behavior

https://docs.gofiber.io/api/middleware/requestid#config should have `ContextKey interface{}`

### Fiber Version

v2.42.0

### Code Snippet (optional)

_No response_

### Checklist:

- [X] I agree to follow Fiber's [Code of Conduct](https://github.com/gofiber/fiber/blob/master/.github/CODE_OF_CONDUCT.md).
- [X] I have checked for existing issues that describe my problem prior to opening this one.
- [X] I understand that improperly formatted bug reports may be closed without explanation.


Discussion:
Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@benjajaja can you help us with a pull request?
yea I can find some time



Patch:
diff --git a/docs/api/middleware/requestid.md b/docs/api/middleware/requestid.md
index 9db86af7b1..7617f76ae9 100644
--- a/docs/api/middleware/requestid.md
+++ b/docs/api/middleware/requestid.md
@@ -61,7 +61,7 @@ type Config struct {
     // the locals for a specific request.
     //
     // Optional. Default: requestid
-    ContextKey string
+    ContextKey interface{}
 }
 ```
 
diff --git a/middleware/requestid/config.go b/middleware/requestid/config.go
index b3b605e590..cc69907822 100644
--- a/middleware/requestid/config.go
+++ b/middleware/requestid/config.go
@@ -26,7 +26,7 @@ type Config struct {
 	// the locals for a specific request.
 	//
 	// Optional. Default: requestid
-	ContextKey string
+	ContextKey interface{}
 }
 
 // ConfigDefault is the default config


Test patch:
diff --git a/middleware/requestid/requestid_test.go b/middleware/requestid/requestid_test.go
index 451e96b4b2..ee3d33d629 100644
--- a/middleware/requestid/requestid_test.go
+++ b/middleware/requestid/requestid_test.go
@@ -55,20 +55,21 @@ func Test_RequestID_Next(t *testing.T) {
 func Test_RequestID_Locals(t *testing.T) {
 	t.Parallel()
 	reqID := "ThisIsARequestId"
-	ctxKey := "ThisIsAContextKey"
+	type ContextKey int
+	const requestContextKey ContextKey = iota
 
 	app := fiber.New()
 	app.Use(New(Config{
 		Generator: func() string {
 			return reqID
 		},
-		ContextKey: ctxKey,
+		ContextKey: requestContextKey,
 	}))
 
 	var ctxVal string
 
 	app.Use(func(c *fiber.Ctx) error {
-		ctxVal = c.Locals(ctxKey).(string) //nolint:forcetypeassert,errcheck // We always store a string in here
+		ctxVal = c.Locals(requestContextKey).(string) //nolint:forcetypeassert,errcheck // We always store a string in here
 		return c.Next()
 	})
Repository: google/go-github (Go)

Issue:
CreateRequiredWorkflow method should be POST instead of PUT
The [CreateRequiredWorkflow](https://github.com/google/go-github/blob/master/github/actions_required_workflows.go#L97) function specified a `PUT` method. As per the [docs](https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#create-a-required-workflow), the method shoud be `POST`.

I'll happily submit this minor fix unless you folks think otherwise.



Discussion:

Patch:
diff --git a/github/actions_required_workflows.go b/github/actions_required_workflows.go
index 11b96f60e4c..3566eb9d207 100644
--- a/github/actions_required_workflows.go
+++ b/github/actions_required_workflows.go
@@ -94,7 +94,7 @@ func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org strin
 // GitHub API docs: https://docs.github.com/en/rest/actions/required-workflows?apiVersion=2022-11-28#create-a-required-workflow
 func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) {
 	url := fmt.Sprintf("orgs/%v/actions/required_workflows", org)
-	req, err := s.client.NewRequest("PUT", url, createRequiredWorkflowOptions)
+	req, err := s.client.NewRequest("POST", url, createRequiredWorkflowOptions)
 	if err != nil {
 		return nil, nil, err
 	}


Test patch:
diff --git a/github/actions_required_workflows_test.go b/github/actions_required_workflows_test.go
index 4298caa0095..a9d63603af9 100644
--- a/github/actions_required_workflows_test.go
+++ b/github/actions_required_workflows_test.go
@@ -83,7 +83,7 @@ func TestActionsService_CreateRequiredWorkflow(t *testing.T) {
 	client, mux, _, teardown := setup()
 	defer teardown()
 	mux.HandleFunc("/orgs/o/actions/required_workflows", func(w http.ResponseWriter, r *http.Request) {
-		testMethod(t, r, "PUT")
+		testMethod(t, r, "POST")
 		testHeader(t, r, "Content-Type", "application/json")
 		testBody(t, r, `{"workflow_file_path":".github/workflows/ci.yaml","repository_id":53,"scope":"selected","selected_repository_ids":[32,91]}`+"\n")
 		fmt.Fprint(w, `{
Repository: gogf/gf (Go)

Issue:
gvalid slice enums verification failed : no pkg path found for type "[]t.Status"
### Go version

go version go1.20.14 darwin/arm64

### GoFrame version

2.7.0

### Can this bug be reproduced with the latest release?

Option Yes

### What did you do?

```go
import (
	"context"
	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/test/gtest"
	"github.com/gogf/gf/v2/util/gtag"
	"testing"
)

func init() {
	gtag.SetGlobalEnums(`{"shop/testing/t.Status":["Running","Offline"]}`)
}

func TestEnums(t *testing.T) {
	type Status string
	const (
		StatusRunning Status = "Running"
		StatusOffline Status = "Offline"
	)
	type BizReq struct {
		Id     int      `v:"required"`
		Name   string   `v:"required"`
		Status []Status `v:"foreach|enums"`
	}
	var (
		ctx = context.Background()
		req = BizReq{
			Id:     1,
			Name:   "john",
			Status: []Status{"Running", "Offline"},
		}
	)
	gtest.C(t, func(t *gtest.T) {
		err := g.Validator().Data(req).Run(ctx)
		t.AssertNil(err)
	})
}

```

### What did you see happen?

no pkg path found for type "[]t.Status"
1.  shop/testing/t.TestEnums.func1
    /Users/xxxx/workspace/go/src/julunet.com/shop/testing/t/f_test.go:54
2.  shop/testing/t.TestEnums
    /Users/xxxx/workspace/go/src/julunet.com/shop/testing/t/f_test.go:52
--- FAIL: TestEnums (0.00s)
FAIL
exit status 1
FAIL    shop/testing/t  0.355s


### What did you expect to see?

verified passed


Discussion:

Patch:
diff --git a/util/gvalid/internal/builtin/builtin_enums.go b/util/gvalid/internal/builtin/builtin_enums.go
index b2f12faf477..071ec4d11fd 100644
--- a/util/gvalid/internal/builtin/builtin_enums.go
+++ b/util/gvalid/internal/builtin/builtin_enums.go
@@ -9,6 +9,7 @@ package builtin
 import (
 	"errors"
 	"fmt"
+	"reflect"
 
 	"github.com/gogf/gf/v2/errors/gcode"
 	"github.com/gogf/gf/v2/errors/gerror"
@@ -47,6 +48,10 @@ func (r RuleEnums) Run(in RunInput) error {
 		pkgPath  = in.ValueType.PkgPath()
 		typeName = in.ValueType.Name()
 	)
+	if in.ValueType.Kind() == reflect.Slice {
+		pkgPath = in.ValueType.Elem().PkgPath()
+		typeName = in.ValueType.Elem().Name()
+	}
 	if pkgPath == "" {
 		return gerror.NewCodef(
 			gcode.CodeInvalidOperation,


Test patch:
diff --git a/util/gvalid/gvalid_z_unit_feature_rule_test.go b/util/gvalid/gvalid_z_unit_feature_rule_test.go
index 853badcf582..c4c10d615a5 100755
--- a/util/gvalid/gvalid_z_unit_feature_rule_test.go
+++ b/util/gvalid/gvalid_z_unit_feature_rule_test.go
@@ -1577,6 +1577,10 @@ func Test_Enums(t *testing.T) {
 			Id    int
 			Enums EnumsTest `v:"enums"`
 		}
+		type SliceParams struct {
+			Id    int
+			Enums []EnumsTest `v:"foreach|enums"`
+		}
 
 		oldEnumsJson, err := gtag.GetGlobalEnums()
 		t.AssertNil(err)
@@ -1596,5 +1600,11 @@ func Test_Enums(t *testing.T) {
 			Enums: "c",
 		}).Run(ctx)
 		t.Assert(err, "The Enums value `c` should be in enums of: [\"a\",\"b\"]")
+
+		err = g.Validator().Data(&SliceParams{
+			Id:    1,
+			Enums: []EnumsTest{EnumsTestA, EnumsTestB},
+		}).Run(ctx)
+		t.AssertNil(err)
 	})
 }
Repository: go-chi/chi (Go)

Issue:
chi.Walk no longer sees routes with custom HTTP methods
In v5.2.3, `chi.Walk` no longer visits routes with custom HTTP methods. For example:
```
package main

import (
	"fmt"
	"net/http"

	"github.com/go-chi/chi/v5"
)

func main() {
	r := chi.NewMux()

	chi.RegisterMethod("QUACK")
	r.MethodFunc("QUACK", "/quack", func(w http.ResponseWriter, r *http.Request) {
		w.WriteHeader(http.StatusOK)
	})

	chi.Walk(r, func(method string, route string, handler http.Handler, _ ...func(http.Handler) http.Handler) error {
		fmt.Println(method, route)
		return nil
	})
}
```

I believe the change responsible for this is https://github.com/go-chi/chi/commit/9b9fb55def404397748a9fc7e044efe9db1d618e, which changed method name lookup to use `reverseMethodMap` instead of a utility function which iterated `methodMap`. As far as I can tell, the problem is that `reverseMethodMap` is not updated by `RegisterMethod`, so the lookup fails and the route is not added.


Discussion:
~@JRaspass mind having a look please?~

You already did :) thanks!



Patch:
diff --git a/tree.go b/tree.go
index b7f20551..8b1ed199 100644
--- a/tree.go
+++ b/tree.go
@@ -71,6 +71,7 @@ func RegisterMethod(method string) {
 	}
 	mt := methodTyp(2 << n)
 	methodMap[method] = mt
+	reverseMethodMap[mt] = method
 	mALL |= mt
 }
 


Test patch:
diff --git a/mux_test.go b/mux_test.go
index 559e0acb..d69a6f8a 100644
--- a/mux_test.go
+++ b/mux_test.go
@@ -1782,6 +1782,26 @@ func TestCustomHTTPMethod(t *testing.T) {
 	if _, body := testRequest(t, ts, "BOO", "/hi", nil); body != "custom method" {
 		t.Fatal(body)
 	}
+
+	var expectRoutes = map[string]string{
+		"GET": "/",
+		"BOO": "/hi",
+	}
+	Walk(r, func(method string, route string, handler http.Handler, _ ...func(http.Handler) http.Handler) error {
+		r, ok := expectRoutes[method]
+		if !ok {
+			t.Fatalf("unexpected method %s", method)
+		}
+		if r != route {
+			t.Fatalf("expected route %s, got %s", r, route)
+		}
+		delete(expectRoutes, method)
+
+		return nil
+	})
+	if len(expectRoutes) != 0 {
+		t.Fatalf("missing expected methods: %v", expectRoutes)
+	}
 }
 
 func TestMuxMatch(t *testing.T) {