Advertisement
Guest User

Seriously difficult question

a guest
Jan 8th, 2017
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.65 KB | None | 0 0
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5.     <!--
  6.     I have the folling variables set from the server-side go-code:
  7.         for _, issue := range issues {
  8.             parse[*issue.ID] = strconv.Itoa(*issue.ID) // This one is global...
  9.             parse[strconv.Itoa(*issue.ID)+"-label"] = "blah blah" // This one is also global
  10.         }
  11.     -->
  12.     {{ range .issues }}
  13.         {{ $ID := .ID }}
  14.         <p>{{ index $.$ID "author" }}</p> <!-- How do I use a variable such as $ID as a global variable such as $.MYID? -->
  15.     {{ end }}
  16. </body>
  17. </html>
  18.  
  19. <!--
  20.     God damn this question is so complicated but hopefully you understand...
  21.     $.$ID returns the error:
  22.         bad character U+0024 '$'
  23.     along with a panic.
  24. -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement