2 ms·
Can you show an example of excessive logic in templates? My experience of Go templates is that they're practically impossible to implement any interesting logic
by solar-ice 4y ago
Can you show an example of excessive logic in templates? My experience of Go templates is that they're practically impossible to implement any interesting logic in, so that's certainly interesting.
- ironmagma 4y agohttps://github.com/go-gitea/gitea/blob/368baf9e77606e5de8bbcda8b0348f1a6fba6d73/templates/repo/issue/view_content/pull.tmpl https://github.com/go-gitea/gitea/blob/368baf9e77606e5de8bbc... Here's a good sample file. The cyclomatic complexity is through the roof: note the variable assignments, function calls, string concatenation, large number of `if`/`else if`s, nested conditional expressions (line 254). I don't even want to know how many permutations of this page are possible...