Skip to content

Access structure element in a for loop #2610

Closed Answered by prakashrj
prakashrj asked this question in Q&A
Discussion options

You must be logged in to vote

Just realized that element I need is already in the for loop.

command: ft_tmpl: {
  for S, C in _bots {
    "render_\(S)": file.Create & {
      filename: "../user_data/ft_\(S).json"
      contents: json.Indent(json.Marshal(C), "", "  ")
    }
  }
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by prakashrj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant