I have a string value that I’d like to convert into an actual object in my 
running program. The string would be read from a configuration file. For 
example, the string "os:Stdin" should be processable somehow to get the 
actual variable os.Stdin. Is that possible in Go? The reflect package seems 
to only work on objects you already have; I’ve also had a look at the 
go/importer package, but that seems to primarily deal with source-level 
information and doesn’t seem to allow you to bridge from there to already 
existing objects in memory. Other-language equivalents would be 
Class.forName(...) in Java or Assembly.GetType(...) in C#. Can anyone 
supply any useful pointers? I know about the plugin package, but AFAIK it 
doesn’t work on Windows.

Regards,

Vinay Sajip

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c8e23c9a-04c2-4bbc-a14d-87ef45ed0009%40googlegroups.com.

Reply via email to