hatmill/attribute/step_test.go

19 lines
408 B
Go
Raw Normal View History

2019-04-23 14:15:17 +00:00
package attribute_test
import (
"gitlab.codemonkeysoftware.net/b/hatmill/attribute"
"gitlab.codemonkeysoftware.net/b/hatmill/element"
"os"
)
func ExampleStep() {
s1 := attribute.Step(attribute.StepAny())
s2 := attribute.Step(attribute.StepFloat(0.5))
e := element.Div()(
element.Input(s1),
element.Input(s2),
)
e.WriteTo(os.Stdout)
// Output: <div><input step='any'><input step='0.5'></div>
}