mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 16:32:09 -05:00
tpl: Add Copyright reference to the Go authors
Also a reference to the `index`issue in Go's issue tracker.
This commit is contained in:
parent
6cb032b67e
commit
941b4caf57
1 changed files with 3 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
||||||
// Copyright 2015 The Hugo Authors. All rights reserved.
|
// Copyright 2015 The Hugo Authors. All rights reserved.
|
||||||
//
|
//
|
||||||
|
// Portions Copyright The Go Authors.
|
||||||
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
// You may obtain a copy of the License at
|
// You may obtain a copy of the License at
|
||||||
|
@ -1326,6 +1328,7 @@ func prepareArg(value reflect.Value, argType reflect.Type) (reflect.Value, error
|
||||||
// indexed item must be a map, slice, or array.
|
// indexed item must be a map, slice, or array.
|
||||||
//
|
//
|
||||||
// Copied from Go stdlib src/text/template/funcs.go.
|
// Copied from Go stdlib src/text/template/funcs.go.
|
||||||
|
// Can hopefully be removed in Go 1.7, see https://github.com/golang/go/issues/14751
|
||||||
func index(item interface{}, indices ...interface{}) (interface{}, error) {
|
func index(item interface{}, indices ...interface{}) (interface{}, error) {
|
||||||
v := reflect.ValueOf(item)
|
v := reflect.ValueOf(item)
|
||||||
if !v.IsValid() {
|
if !v.IsValid() {
|
||||||
|
|
Loading…
Reference in a new issue