[go-nuts] Reflection: How to retrieve index of map

2019-07-01 Thread Mark Bauermeister
I have the following code, where the TokenMap struct is actually part of another package. idMap is not exported and thus not accessible without reflection. Through reflection I can easily find the value of "int", which is "28". Now, I'd like to do the opposite though. I'd like to find "28"'s ind

[go-nuts] Re: [ANN] Gio: portable immediate mode GUI programs in Go for iOS/tvOS, Android, macOS, Linux, Windows

2019-06-14 Thread Mark Bauermeister
Any plans for a Vulkan back-end? -- 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 visi

[go-nuts] make an empty slice

2019-06-06 Thread Mark Bauermeister
You mean a slice that is not of type Exam? test []int Should work. Your slice does need to adhere to some type. -- 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

[go-nuts] Memory allocation question

2019-06-06 Thread Mark Bauermeister
Sorry in advance for the somewhat messy code, but this is something I've been trying to understand all day and can't quite come up with an explanation for. Basically, I wrote the below code to experiment with different data types and their impact on performance and memory efficiency. The code i

[go-nuts] Re: Write to bufio Scanner from outside os.Stdin

2019-05-29 Thread Mark Bauermeister
= "Test \n") and the reader should pick it up as if it was a manual input. Unfortunately, that doesn't quite seem to work yet. On Wednesday, 29 May 2019 19:26:58 UTC+2, Mark Bauermeister wrote: > > I'm in the process of writing a text adventure parser. > By

[go-nuts] Write to bufio Scanner from outside os.Stdin

2019-05-29 Thread Mark Bauermeister
I'm in the process of writing a text adventure parser. By default, the parser simply uses Stdin. i e for { fmt.Print(">>> ") reader := bufio.NewScanner(os.Stdin) for reader.Scan() { switch reader.Text() { ... ... This is quite convenient. However, I now want

[go-nuts] Re: Any alternative to go-bindata that supports dynamic assets?

2019-05-26 Thread Mark Bauermeister
, 26 May 2019 15:44:01 UTC+2, Mark Bauermeister wrote: > > My use case is a game engine that uses Lua scripts. > Naturally, Lua scripts can be changed during runtime without rebuilding > the entire project. > > Since go-bindata doesn't actually load the file during runtime bu

[go-nuts] Any alternative to go-bindata that supports dynamic assets?

2019-05-26 Thread Mark Bauermeister
My use case is a game engine that uses Lua scripts. Naturally, Lua scripts can be changed during runtime without rebuilding the entire project. Since go-bindata doesn't actually load the file during runtime but merely precompiles it to a string representation, it doesn't work for dynamic conten

[go-nuts] Go-SQLite3: Convert between string and slice

2019-05-05 Thread Mark Bauermeister
type Country struct { ID int`json:"id"` States string `json:"states"` } var Countries []Country func getAllCountries() { rows, err := db.Query("select id, states from countries") if err != nil { astilog.Error(err) } defer rows.Close() for rows.Next(

[go-nuts] Extend map with another map

2019-05-03 Thread Mark Bauermeister
t;Cloak of Darkness", Author: "Roger Firth (implemented by Mark Bauermeister)", Intro: `Hurrying through the rainswept November night, you're glad to see the bright lights of the Opera House. It's surprising that there aren't mor

[go-nuts] Re: Gomobile Reverse Bindings: Cannot import any android packages

2019-04-25 Thread Mark Bauermeister
ation/nil pointer error. > I suspect one needs to somehow get the right context from the Java side. > Question is how. > > I already tried an OnCreate override func, but that one is somehow never > called. > > On Wednesday, 24 April 2019 15:08:02 UTC+2, ma...@eliasnaur.com w

[go-nuts] Re: Gomobile Reverse Bindings: Cannot import any android packages

2019-04-24 Thread Mark Bauermeister
is how. I already tried an OnCreate override func, but that one is somehow never called. On Wednesday, 24 April 2019 15:08:02 UTC+2, ma...@eliasnaur.com wrote: > > > > On Wednesday, April 24, 2019 at 2:34:34 PM UTC+2, Mark Bauermeister wrote: >> >> I'm currently exper

[go-nuts] Gomobile Reverse Bindings: Cannot import any android packages

2019-04-24 Thread Mark Bauermeister
I'm currently experimenting with Gomobile Reverse Bindings (my hope is to eventually be able to call getFilesDir(), so I can save my SQLite3 DB on mobile) and it is, quite literally, driving me insane. I've followed the sparse information available, was able to successfully work with 'import "Ja