func (f *FieldSetType) AddTag(tag string) *FieldSetType {
	f.tags[tag] = struct{}{}
	return f
}
AddTag adds a no-value parameter (e.g.: "disabled", "checked") to the fieldset.
package forms
import (
	"bytes"
	"github.com/kirves/go-form-it/common"
	"github.com/kirves/go-form-it/fields"
	"html/template"
)
type FieldSetType struct {
	name     string
	class    map[string]struct{}
	tags     map[string]struct{}
	fields   []fields.FieldInterface
	fieldMap map[string]int
}
func (f *FieldSetType) Render() template.HTML {
	var s string
	buf := bytes.NewBufferString(s)
	data := map[string]interface{}{
		"fields":  f.fields,
		"classes": f.class,
		"tags":    f.tags,
	}
	err := template.Must(template.ParseFiles(formcommon.CreateUrl("templates/fieldset.html"))).Execute(buf, data)
	if err != nil {
		panic(err)
	}
	return template.HTML(buf.String())
}
func FieldSet(name string, elems ...fields.FieldInterface) *FieldSetType {
	ret := &FieldSetType{
		name,
		map[string]struct{}{},
		map[string]struct{}{},
		elems,
		map[string]int{},
	}
	for i, elem := range elems {
		ret.fieldMap[elem.Name()] = i
	}
	return ret
}
func (f *FieldSetType) Field(name string) fields.FieldInterface {
	ind, ok := f.fieldMap[name]
	if !ok {
		return &fields.Field{}
	}
	return f.fields[ind].(fields.FieldInterface)
}
func (f *FieldSetType) Name() string {
	return f.name
}
func (f *FieldSetType) AddClass(class string) *FieldSetType {
	f.class[class] = struct{}{}
	return f
}
func (f *FieldSetType) RemoveClass(class string) *FieldSetType {
	delete(f.class, class)
	return f
}