On Sun, 26 Feb 2017 16:53:48 -0800 (PST)
Curtis Paul <[email protected]> wrote:

> I have the following code.
> 
> How might I parse the os.Stdout data into a map?
> 
> Basically I want to read audio interfaces and put them in some sort
> of data structure.

Can you elaborate on your approach a bit?

The thing is, portaudio.HostApis() already returns you a value which
is "some sort of data structure" -- a slice of pointers to values of
type portaudio.HostApiInfo (which itself is a struct), so in your
code...

> package main
> 
> import (
> "github.com/gordonklaus/portaudio"
[...]
> hs, err := portaudio.HostApis()

...the hs variable already contains a list of supported host APIs.

Now you do

[...]
> err = tmpl.Execute(os.Stdout, hs)
[...]

which supposedly should render your template with the values in hs.

That's sort of sensible, but in the opening passage of your mail you
state that you want to "...parse the os.Stdout data into a map" which
implies you now want to read the data rendered by the template and
parse it back?  But this bears the question: why the heck you'd want to
do that if you already has the data on your hand -- the data you
submitted to the templating engine?

What's your actual intent?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to