func BenchmarkParseBytes(b *testing.B) { for i := 0; i < b.N; i++ { _, err := forge.ParseBytes(exampleConfigBytes) if err != nil { b.Fatal(err) } } }
func TestParseBytes(t *testing.T) { settings, err := forge.ParseBytes(testConfigBytes) if err != nil { t.Fatal(err) } values := settings.ToMap() assertDirectives(values, t) }
func ExampleParseBytes() { // Parse a `SectionValue` from []byte containing the config data := []byte("amount = 500;") settings, err := forge.ParseBytes(data) if err != nil { panic(err) } fmt.Println(settings.GetInteger("amount")) }