package editor import ( "bytes" "reflect" ) // 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 { var wrapInLabel = true label, found := attrs["label"] if !found { wrapInLabel = false label = "" } e := newElement("input", label, fieldName, p, attrs) return domElementSelfClose(e, wrapInLabel) } // Textarea returns the []byte of a