mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-22 06:47:00 +00:00
16 lines
380 B
Go
16 lines
380 B
Go
package tests
|
|
|
|
import (
|
|
"testing"
|
|
"github.com/modern-go/reflect2"
|
|
)
|
|
|
|
func Test_slice_bytes(t *testing.T) {
|
|
t.Run("SetIndex", testOp(func(api reflect2.API) interface{} {
|
|
obj := [][]byte{[]byte("hello"), []byte("world")}
|
|
valType := api.TypeOf(obj).(reflect2.SliceType)
|
|
valType.SetIndex(&obj, 0, []byte("hi"))
|
|
valType.SetIndex(&obj, 1, []byte("there"))
|
|
return obj
|
|
}))
|
|
} |