package editor import ( "bytes" "fmt" "html" "reflect" "strings" ) type element struct { TagName string Attrs map[string]string Name string label string data string viewBuf *bytes.Buffer } // Input returns the []byte of an HTML element with a label. // IMPORTANT: // The `fieldName` argument will cause a panic if it is not exactly the string // form of the struct field that this editor input is representing func Input(fieldName string, p interface{}, attrs map[string]string) []byte { e := newElement("input", attrs["label"], fieldName, p, attrs) return domElementSelfClose(e) } // Textarea returns the []byte of a