MCPcopy Create free account
hub / github.com/nginx-proxy/docker-gen / getArrayValues

Function getArrayValues

internal/template/template.go:26–43  ·  view source on GitHub ↗
(funcName string, entries interface{})

Source from the content-addressed store, hash-verified

24)
25
26func getArrayValues(funcName string, entries interface{}) (*reflect.Value, error) {
27 entriesVal := reflect.ValueOf(entries)
28
29 kind := entriesVal.Kind()
30
31 if kind == reflect.Ptr {
32 entriesVal = entriesVal.Elem()
33 kind = entriesVal.Kind()
34 }
35
36 switch kind {
37 case reflect.Array, reflect.Slice:
38 break
39 default:
40 return nil, fmt.Errorf("must pass an array or slice to '%v'; received %v; kind %v", funcName, entries, kind)
41 }
42 return &entriesVal, nil
43}
44
45func newTemplate(name string) *template.Template {
46 tmpl := template.New(name)

Callers 4

generalizedWhereFunction · 0.85
setMethod · 0.85
generalizedGroupByFunction · 0.85
TestGetArrayValuesFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestGetArrayValuesFunction · 0.68