Re: [go-nuts] Getting from a string to an object value - how?

2020-01-15 Thread 'Vinay Sajip' via golang-nuts
On Tuesday, 14 January 2020 21:58:01 UTC, Ian Lance Taylor wrote: > In general this is not possible in Go. Sorry. > > If you can restrict yourself to exported package-scope variables, then > you can probably use the debug/pe (on Windows) package to look up the > symbol name and use that

[go-nuts] Getting from a string to an object value - how?

2020-01-14 Thread 'Vinay Sajip' via golang-nuts
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