Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

style: iterate the rel attribute tokens without building a slice

Xan Torresc7b37a152b50
diff --git a/internal/controller/template_controller.go b/internal/controller/template_controller.go
index 3c102166..4343738a 100644
--- a/internal/controller/template_controller.go
+++ b/internal/controller/template_controller.go
@@ -117,7 +117,7 @@ func GetStyle() (script []string, css []string) {
if !ok {
return false
}
- for _, tok := range strings.Fields(rel) {
+ for tok := range strings.FieldsSeq(rel) {
if strings.EqualFold(tok, "stylesheet") {
return true
}