Skip to content

text/template: cannot index with literal integer from map[int32]string  #20439

@bupjae

Description

@bupjae

What version of Go are you using (go version)?

go1.8

What operating system and processor architecture are you using (go env)?

(go playground)

What did you do?

https://play.golang.org/p/dMKNy4pTnb

What did you expect to see?

[ ok] Element 0 is zero
[ ok] Element 0 is zero
[ ok] Element 0 is zero

What did you see instead?

[ ok] Element 0 is zero
[ ok] Element 0 is zero
[err] template: :1:15: executing "" at <index . 0>: error calling index: value has type int; should be int32 

I think "untyped" integer in template should become not only "int", but also "int32", "int64", ......

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions