[go-nuts] Re: Using React with Golang? and does it make sense?

2017-02-06 Thread mark
in the render path. I have no idea if otto can run the current version of React, and it's been so long since I've tried using otto with React that I won't be able to answer any questions about that setup. Hopefully this was still useful information. [1] https://github.com/mark-rushakoff/go-reactjs

[go-nuts] Re: correct way to convert wchar_t* to string ?

2017-02-28 Thread Mark
That works perfectly - thanks! On Tuesday, February 28, 2017 at 1:51:49 AM UTC, brainman wrote: > > I would just use syscall.UTF16ToString: > https://play.golang.org/p/jGmQXHtoRT > > Alex > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Calling functions in a Windows DLL from Go

2017-02-27 Thread Mark
I've used syscall.MustLoadDLL to load a DLL and MustFindProc to get *syscall.Procs to the functions I need. However, I can't find the info I need in the docs (if it is there a link would be great!) If a DLL function returns an int >=0 in r1 do I need to cast this to a uintptr or can I just

[go-nuts] correct way to convert wchar_t* to string ?

2017-02-27 Thread Mark
In a Windows DLL that I'm accessing from Go one of the functions returns a wchar_t* containing some text. This comes back as a uintptr in r1. Here's my conversion function -- is it reasonable? func CwcharToString(p uintptr) string { if p == 0 { return "" } uints :=

[go-nuts] Re: Go app using 1 thread when GOMAXPROCS is 4 on Windows 7 in VirtualBox

2017-02-27 Thread Mark
time/ > > runtime.NumCPU() > will report the logical CPU count and > runtime.GOMAXPROCS(n int) int > will set the MAX number of threads at runtime. > > > On Monday, February 27, 2017 at 1:13:33 PM UTC-6, Mark wrote: >> >> Yes, in VirtualBox on this machine I have Pr

[go-nuts] Go app using 1 thread when GOMAXPROCS is 4 on Windows 7 in VirtualBox

2017-02-27 Thread Mark
I have a Go app that only uses 1 thread when GOMAXPROCS is 4 on Windows 7-64bit inside VirtualBox even though I can have up to 20 goroutines. Is this a known problem? And is there a solution that can force Go to use all 4 CPUs? (The underlying hardware is a 64-bit i7.) Thanks. -- You received

[go-nuts] Re: correct way to convert wchar_t* to string ?

2017-02-27 Thread Mark
Ooops just realised that I didn't enforce the max chars limit. Here's another version: func CwcharToString(p uintptr, maxchars int) string { if p == 0 { return "" } uints := make([]uint16, 0, maxchars) for i, p := 0, uintptr(unsafe.Pointer(p)); i < maxchars; p += 2 {

[go-nuts] Re: Go app using 1 thread when GOMAXPROCS is 4 on Windows 7 in VirtualBox

2017-02-27 Thread Mark
t; > Are you sure your virtual machine has 4 cores assigned? You might have 4 > cores, but when you create the VM you can assign any number of cores to it > (1 being default IIRC). > > On Monday, February 27, 2017 at 12:39:31 PM UTC-6, Mark wrote: >> >> I just tried this on

[go-nuts] Re: correct way to convert wchar_t* to string ?

2017-02-27 Thread Mark
you! On Monday, February 27, 2017 at 6:10:14 PM UTC, peterGo wrote: > > Mark, > > For example, > > Go Playground: https://play.golang.org/p/dv48PLY-CD > > Peter > > On Monday, February 27, 2017 at 11:05:32 AM UTC-5, Mark wrote: >> >> Ooops just realised tha

[go-nuts] Re: correct way to convert wchar_t* to string ?

2017-02-27 Thread Mark
One tiny suggestion s[:i] https://play.golang.org/p/_T_hqBg6ka Thanks:-) On Monday, February 27, 2017 at 6:36:06 PM UTC, peterGo wrote: > > Mark, > > Fixed typos and made minor improvements. > > Go Playground: https://play.golang.org/p/cbQL8-72s5 > > Peter > > On M

[go-nuts] Re: correct way to convert wchar_t* to string ?

2017-02-27 Thread Mark
Oh, and make wcMax of 0 produce default of max (otherwise it doesn't make sense to have 0 chars?) https://play.golang.org/p/2rLtWFGhpW On Monday, February 27, 2017 at 6:41:50 PM UTC, Mark wrote: > > One tiny suggestion s[:i] > > https://play.golang.org/p/_T_hqBg6ka > > Thank

[go-nuts] Re: Rune-by-rune through a stream

2016-11-06 Thread mark
The io package has the RuneReader interface. You can wrap a generic io.Reader in a bufio.Reader or if you already have a string or byte slice, you can use strings.Reader or bytes.Reader respectively, to get a RuneReader. On Saturday, November 5, 2016 at 10:40:34 PM UTC-7, so.q...@gmail.com

[go-nuts] Re: Error when using go tool trace

2016-11-02 Thread mark
On Tuesday, October 11, 2016 at 7:21:17 AM UTC-7, xavier zebier wrote: > > C:\repo\gonew\src\github.com\tixu\trace>go tool trace Trace > 2016-10-11T153554.out > 2016/10/11 15:36:45 Parsing trace... > failed to parse trace: no EvFrequency event > > Can you help me .? > > Thanks in advance, > >

[go-nuts] Re: How many bytes binary.Write write before an error?

2016-12-15 Thread mark
On Thursday, December 15, 2016 at 6:05:53 PM UTC-8, Peng Wang wrote: > > Actually I don't really care about that, just don't want break the > interface requirement > in the doc it says "WriteAt writes len(p) bytes from p to the underlying > data stream at offset off. It returns the number of

[go-nuts] Re: bit twiddling API survey

2017-01-09 Thread mark
I haven't personally experienced a need for a bit twiddling API, but if you're looking for other interesting operations, you might want to check out the awesome-bits curated list of bitwise operations [1]. [1] https://github.com/keonkim/awesome-bits On Monday, January 9, 2017 at 3:46:45 PM

[go-nuts] Re: Go 1.8 Beta 1 is released

2016-12-02 Thread mark
The last sentence under the Compiler Toolchain heading: > Compared to the previous release, Go 1.8 is about 15% faster . This would be a little more clear if it said something more like "Compared to the previous release,

[go-nuts] When should (or shouldn't) I use (*testing.T).Parallel()?

2017-01-09 Thread mark
The godoc for (*testing.T).Parallel() only says: > Parallel signals that this test is to be run in parallel with (and only with) other parallel tests. Searching for "t.Parallel()" on golang.org shows some usage in net/timeout_test.go but little use elsewhere. I would guess t.Parallel() would

Re: [go-nuts] Re: JSON smart parsing

2016-12-20 Thread mark
https://github.com/json-iterator/go was recently trending on GitHub. I haven't used it personally but it sounds like it might fit your use case. On Tuesday, December 20, 2016 at 11:43:53 AM UTC-8, Alexander Petrovsky wrote: > > Yep, I can, and I've already reads this article, but as I said, I

[go-nuts] Re: Unable to use net/http/pprof to profile live webserver

2016-12-23 Thread mark
Besides the HTTP standard approach and the workaround that Shawn mentioned, a couple other options include: * installing the gops agent [1] in the binary and using the gops CLI when SSHed onto the machine * adding your own hook (via CLI, custom HTTP endpoint, on a timer, etc.) to directly

[go-nuts] Re: 2016 Go User Survey results

2017-03-06 Thread mark
I haven't noticed an announcement on the mailing list yet, but I saw the corresponding Github issue closed with a link to the survey results: https://blog.golang.org/survey2016-results On Sunday, January 22, 2017 at 4:26:00 AM UTC-8, Matt Joiner wrote: > > The go user survey

[go-nuts] Re: Weird GOPATH issue with go 1.8.

2017-03-04 Thread mark
Run `type go` to see if `go` is an alias or function that is executing the go binary with GOPATH set. On Saturday, March 4, 2017 at 3:25:34 PM UTC-8, Bruno Albuquerque wrote: > > Something appears to be broken: > > $ echo $GOPATH > /home/bga/go-dev > > $ echo $GOBIN > /home/bga/go-dev/bin > > $

[go-nuts] Any way to access the raw IANA Timezone data?

2017-08-13 Thread mark
implementation. It just needs to be made public. Related question: Does this sound like something worth proposing a change to the time package to add? The pain of dealing with timezones would be greatly eased by not having to compile the IANA database from scratch. Thanks, Mark Stenglein

[go-nuts] Re: Go 1.8.3 is released

2017-05-25 Thread mark
The Go1.8.2 and Go 1.8.3 milestones on GitHub are still open. If there's a manual checklist for Go releases, can someone see that closing the GitHub milestone is added to that checklist? On Wednesday, May 24, 2017 at 2:12:52 PM UTC-7, Chris Broadfoot wrote: > > Hi gophers, > > We have just

[go-nuts] In CI, if I run `go test -race`, should I bother to also `go test` without -race?

2017-09-15 Thread mark
In CI, if we're going to run unit tests under the race detector, is there any value in running unit tests again _without_ the race detector? I'm inclined to say yes, since in production customers won't be running with the race detector enabled; but it feels like the answer should be no since

[go-nuts] Re: Updating specific elements of a big json file.

2018-01-11 Thread mark
Maybe JSON patches are what you're looking for. https://github.com/evanphx/json-patch On Thursday, January 11, 2018 at 2:36:01 PM UTC-8, Doğan Kurt wrote: > > I think i wasn't perfectly clear. When i say update i actually meant > insert, delete, update. > > I will delete big blocks of

Re: [go-nuts] Golang package docs site sluggish recently

2018-08-17 Thread mark
This is still happening. I just opened https://github.com/golang/go/issues/27057 to track it. On Thursday, June 7, 2018 at 9:58:26 PM UTC-7, Chris Broadfoot wrote: > > Should be fast again now. I'm not sure what happened, but it appears the > site search index was missing for a previous deploy.

[go-nuts] Re: Regarding string immutablity

2018-08-28 Thread mark
https://github.com/awnumar/memguard is the only project I've noticed that attempts to deal with string security in Go. I haven't used it personally. On Tuesday, August 28, 2018 at 9:45:29 AM UTC-7, Jay Sharma wrote: > > *@Jan*, The example you shown it is copying a string to new variable. but

[go-nuts] Re: What's the status of the new Go brand?

2018-08-26 Thread mark
I filed an issue for package doc slowness about 9 days ago: https://github.com/golang/go/issues/27057 On Saturday, August 25, 2018 at 10:26:54 PM UTC-7, Steve Roth wrote: > > Hmm, I wouldn't say "nothing" has changed. The golang.org site has > gotten noticeably slower, particularly the package

[go-nuts] Re: Why can't I see the whole stack trace of goroutine

2018-11-08 Thread mark
> What you really want is the stack trace for the goroutine that created the leaking goroutine, at the time that the leak was created. GODEBUG=tracebackancestors=1 ought to show that. tracebackancestors is new in Go 1.11 IIRC. https://golang.org/pkg/runtime/#hdr-Environment_Variables On

[go-nuts] How can I identify the default value of the -p build flag?

2018-11-02 Thread mark
This is somewhat an XY problem, so let me preface with the X: We infrequently see `/usr/local/go/pkg/tool/linux_amd64/link: signal: killed` when running `go test` for our project on CircleCI, running Go 1.11.1. As far as I can tell, that killed signal is due to OOMing. The comment at

[go-nuts] Re: Is it safe to run go build in parallel?

2018-10-01 Thread mark
https://github.com/golang/go/issues/26794 is "can't run go builds concurrently if they download modules". In that issue, Russ says: > There is a plan to make downloading of modules by parallel go commands safe but we haven't done that yet. On Monday, October 1, 2018 at 8:43:00 AM UTC-7,

[go-nuts] Re: Go 1.11.4 and Go 1.10.7 are released

2018-12-17 Thread mark
I think we're just waiting on this PR to get merged: https://github.com/docker-library/official-images/pull/5197 And then the official docker images should start building automatically. On Monday, December 17, 2018 at 1:27:01 PM UTC-5, Elliott Polk wrote: > > Will there be a Docker image update

[go-nuts] Is it possible with go modules to `go get` the ref (not the SHA) of an GitHub PR?

2018-12-04 Thread mark
I have a private github repository that depends on an open source github repository. There's an open PR in the open source repo, and I'd like to `go get` that change to test it locally in my private repo. Normally, when I update the open source repository, I can just run `go get

[go-nuts] Tips for reproducing flaky Go tests

2019-08-15 Thread mark
I put together a blog post on reproducing flaky Go tests: https://www.influxdata.com/blog/reproducing-a-flaky-test-in-go/ This was the result of what I've learned spending many, many hours hunting down many unreliable tests. I hope these tips can help you out next time you have a test that

[go-nuts] InfluxData is hiring remote Go engineers

2019-09-26 Thread mark
InfluxData is the leading open source time series database, purpose built for monitoring metrics and events. We are expanding our talented engineering organization, and we are hiring for a lot of positions that primarily include programming in Go. I am personally one of Influx's first

[go-nuts] JSON: Having trouble parsing map keys with dots like {"foo.bar":"baz"}

2020-01-28 Thread mark
if f.Qux != "hi" { t.Fatalf("Expected f.Qux to be hi") } if f.BazBar != "hello" { t.Errorf("wanted: hello, got: %q", f.BazBar) } } And the Qux field passes fine, but the BazBar field is not set, so the test fails there: --- FAIL: TestDotKeyJsonParsing (0

[go-nuts] [generics] tiny typo in Map/Reduce/Filter examples

2020-06-17 Thread Mark
At the end of this section where it shows the outputs: ```go floats := slices.Map(s, func(i int) float64 { return float64(i) })// Now float2 is []float64{1.0, 2.0, 3.0}. ``` shouldn't that be: ```go floats := slices.Map(s, func(i int) float64 { return float64(i) })// Now floats is

[go-nuts] Re: Trouble querying REST API with net/http (api verified working with curl)

2016-06-26 Thread mark mellar
For anyone else having similar issues, I found I was able to work around this by using client.Get() rather than client.Do(). Still not sure what the root cause is though... Cheers. On Friday, June 24, 2016 at 7:32:36 AM UTC+1, mark mellar wrote: > > Good tip on using httputil to i

[go-nuts] Panic in go1.8rc3 using cgo to get binary data from database

2017-02-11 Thread Mark Crook
= C.GoBytes(unsafe.Pointer(value.buffer), C.int(value.length)) I haven't seen the panic if the last line is commented out. Below is a stack trace. Perhaps it panics when a garbage collection is triggered while waiting for C.GoBytes to return? Any suggestions? Thank you, Mark runtime: unexpected

[go-nuts] Re: Panic in go1.8rc3 using cgo to get binary data from database

2017-02-12 Thread Mark Crook
Thanks Damian On Monday, 13 February 2017 04:29:59 UTC+13, Damian Gryski wrote: > > Please file an issue at https://golang.org/issues > > Damian > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

[go-nuts] Re: Panic in go1.8rc3 using cgo to get binary data from database

2017-02-13 Thread Mark Crook
ny rows each with a single binary column value up to around 10Mb Any suggestions appreciated! Thanks, Mark On Monday, 13 February 2017 12:51:28 UTC+13, Daniel Theophanes wrote: > > It is difficult to be certain, but I would put my bets on your sql > anywhere driver may not be hand

[go-nuts] Re: Performance Counters

2016-08-29 Thread Mark Richman
it datadog (you can use any > monitoring tool you wish though) > > https://www.datadoghq.com/blog/instrument-go-apps-expvar-datadog/ > > Hope that's what you were looking for. > > Thanks > > Diego > > > On Monday, August 29, 2016 at 12:34:26 AM UTC-4, Mark Ri

Re: [go-nuts] What 5 things does Go need in 2017?

2016-09-11 Thread Mark Richman
this is a relatively language-agnostic discipline. However, I know of the vendoring quirks and lack of portable libraries (i.e. dll or jar style references). If you think these are areas I could be of service, feel free to follow up with me offline if you like. Thanks, Mark http://markrichman.com

[go-nuts] Rational number to floating point

2016-09-19 Thread Mark Longtin
Hey guys, I'm new to Go - through the Ivy app on IOS- so I have a newbie question. What's the easiest way to cast or convert a rational number to its floating point representation? EG, looking for something like this: *float 355/113*3.14159292035 I could do something inelegant like

[go-nuts] Re: Ignoring UTF-8 BOM when decoding JSON

2016-09-23 Thread Mark Richman
Json RFC: > https://tools.ietf.org/html/rfc7159#section-8.1 > > On Friday, 23 September 2016 12:37:56 UTC+1, Mark Richman wrote: >> >> I have a JSON file which begins with the UTF-8 byte-order marker (BOM) >> 0xEF 0xBB 0xBF. >> >> This causes Decode() to fail with

[go-nuts] Performance Counters

2016-08-28 Thread Mark Richman
I'm relatively new to Go, coming from a Windows/.NET background primarily. Does the Go runtime itself offer performance counters similar to what Windows makes available via perfmon? Specifically, I'm looking to capture realtime (not via a dump) metrics on heap usage, thread counts, GC

Re: [go-nuts] Packaging Test Utilities in a Project

2016-12-18 Thread Mark Mandel
Any reason not to have a `utils_test.go` file - and puts your utilities in there? Seems like the simplest solution. Then they only get included for your tests. Using /internal for testing tools feels a bit strange to me IMHO. Mark On 18 December 2016 at 11:13, Matt Harden <matt.

Re: [go-nuts] x/crypto/ssh server question

2016-12-18 Thread Mark Adams
ication code. I hope that helps! Mark On Sun, Dec 18, 2016 at 5:22 AM <andrewchambe...@gmail.com> wrote: > I am trying to get access to get public key that was used to authenticate > an ssh connection (https://godoc.org/golang.org/x/crypto/ssh#ConnMetadata) > inside the Public

Re: [go-nuts] globals defined by stringer utility

2018-05-08 Thread Mark Nahabedian
Thanks Rob. I wasn't concerned with the format if the code but of the (admittedly unlikely) chance that other code could accidentally collide with those globals. On May 8, 2018 2:35 AM, Rob Pike wrote: I don't see that it matters much either way. It's clean enough as it is.

Re: [go-nuts] Ternary ... again

2018-08-15 Thread Mark Volkmann
using it on real projects. Getting more developers to consider Go makes that more likely. --- R. Mark Volkmann Object Computing, Inc. > On Aug 14, 2018, at 12:18 PM, Axel Wagner > wrote: > > There is lots of discussion findable here: > https://groups.google.com/forum/#!searchi

[go-nuts] Ternary ... again

2018-08-14 Thread Mark Volkmann
a good idea if the values come from function calls since there would sometimes be needless function calls. var color = “blue” if temperature > 100 { color = “red” } --- R. Mark Volkmann Object Computing, Inc. -- You received this message because you are subscribed to the Google Groups &qu

[go-nuts] reflect to get value type of a map

2018-08-30 Thread Mark Volkmann
I see that I can use the `reflect` package to get the key type of a map like this: ```go mt := reflect.TypeOf(myMap) fmt.Println("key type is", mt.Key()) ``` But I don't see a way to get the value type of a map. Is there a method to do this? -- R. Mark Volkmann Object Computing, Inc

Re: [go-nuts] Re: Opening brace can't be placed on a separate line killing the language for me

2018-09-08 Thread Mark Volkmann
How did you do that? I don’t see any formatting configuration. --- R. Mark Volkmann Object Computing, Inc. > On Sep 8, 2018, at 3:48 AM, Jan Mercl <0xj...@gmail.com> wrote: > > On Sat, Sep 8, 2018 at 10:14 AM Dave Cheney wrote: > > > I personally don't like that

Re: [go-nuts] Re: "file already closed" occurring on Linux only (possible bug?)

2018-03-01 Thread Mark Sheahan
all reads from the pipe have completed." > > Put wg.Wait() of the read/writes from/to the pipes before calling > sess.Wait(). (So it is not ok to call it in a goroutine). > > > 2018. március 1., csütörtök 21:01:17 UTC+1 időpontban Mark Sheahan a > következőt írta:

[go-nuts] "file already closed" occurring on Linux only (possible bug?)

2018-03-01 Thread Mark Sheahan
We've had an integration test that has very occasionally failed since go 1.8.x, which is that a pipe reader appears to be getting closed rather than just giving EOF when the writer is closed. An isolated test case is here in this repository: https://github.com/marksheahan/pipebug, just checkout

Re: [go-nuts] Go modules and replace

2018-10-19 Thread Mark Volkmann
> On Oct 19, 2018, at 4:48 PM, Justin Israel wrote: > > > >> On Sat, Oct 20, 2018, 9:42 AM Mark Volkmann >> wrote: >> I have a simple demo application that wants to use a package that is on my >> local file system. >> The code for the package is

[go-nuts] Go modules and replace

2018-10-19 Thread Mark Volkmann
I have a simple demo application that wants to use a package that is on my local file system. The code for the package is in /Users/Mark/foo/bar. This directory contains the file bar.go which contains: package bar import "fmt" func Hello() { fmt.Println("Hello from bar!")

Re: [go-nuts] Go modules and replace

2018-10-19 Thread Mark Volkmann
, Oct 19, 2018 at 6:13 PM Paul Jolly wrote: > Hi Mark, > > When importing a module package, the first element in the path must > contain a ".". Hence "foo" is invalid. Here is a working example: > > $ cd $HOME > $ mkdir bar > $ cd bar > $ go mod init ex

Re: [go-nuts] Go modules and replace

2018-10-19 Thread Mark Volkmann
I see though that "go mode edit" really wants there to be a dot in the first part of the import path. Where can I read about that requirement? On Fri, Oct 19, 2018 at 6:30 PM Mark Volkmann wrote: > Thank you so much! I actually got it to work without having a dot in the

Re: [go-nuts] How can I identify the default value of the -p build flag?

2018-11-02 Thread Mark Rushakoff
Thanks. That confirms that Go thinks there are 36 CPUs available in that environment. I'm still a bit surprised that there's no way to invoke the go executable to get the value of runtime.NumCPU. A quick grep through src/cmd looks like it isn't directly exposed anywhere. I might file an issue

Re: [go-nuts] [ANN] Koazee a library inspired by functional programming and lazy evaluation that takes the hassle out of working with arrays

2018-11-11 Thread Mark Volkmann
Wow, this is a wonderful library! Thanks so much for creating this! --- R. Mark Volkmann Object Computing, Inc. > On Nov 11, 2018, at 1:27 PM, Iván Corrales Solera > wrote: > > Hey guys, last weeks I've been working on Koazee and I just released a very > first versi

Re: [go-nuts] [ANN] Koazee a library inspired by functional programming and lazy evaluation that takes the hassle out of working with arrays

2018-11-13 Thread Mark Volkmann
-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed t

Re: [go-nuts] Re: Is it safe to run go build in parallel?

2018-10-01 Thread Mark Rushakoff
afe, but if you have a reproducer that shows otherwise, that's probably worthy of its own issue. On Mon, Oct 1, 2018 at 10:50 AM Yulrizka wrote: > Hi Mark, > > what I find interesting is that I haven't enable go module yet. > As you can see in the errors that I'm still using a v

Re: [go-nuts] Re: pass interface

2018-12-10 Thread Mark Volkmann
Mon, Dec 10, 2018 at 3:28 PM Dan Kortschak wrote: > No, it is possible, but you need to pass the pointer to the interface. > You can then use reflect to interrogate the interface value. > > The bigger question, and one that would help here would be what is it > that you are actual

Re: [go-nuts] Re: pass interface

2018-12-10 Thread Mark Volkmann
Thanks so much Dan! --- R. Mark Volkmann Object Computing, Inc. > On Dec 10, 2018, at 8:34 PM, Dan Kortschak wrote: > > https://play.golang.org/p/VWPb_AcgUrl > >> On Mon, 2018-12-10 at 20:14 -0600, Mark Volkmann wrote: >> Here is some code that shows a part of what I'

[go-nuts] reflect Kind method

2018-12-24 Thread Mark Volkmann
the index excludes the Kind method in the list of Type methods? -- R. Mark Volkmann Object Computing, Inc. -- 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 e

Re: [go-nuts] reflect Kind method

2018-12-24 Thread Mark Volkmann
c 24, 2018 at 12:04 PM Ian Lance Taylor wrote: > On Mon, Dec 24, 2018 at 9:29 AM Mark Volkmann > wrote: > > > > IIUC, Kind is a method of both Type and Value. But the index near the > top of https://golang.org/pkg/reflect/ only shows it as a method of > Value. If you

Re: [go-nuts] reflect Kind method

2018-12-24 Thread Mark Volkmann
Maybe it would be good to add an indication of just the basic type of each type in the index. For example, is the type a struct, interface, or something else? --- R. Mark Volkmann Object Computing, Inc. > On Dec 24, 2018, at 12:35 PM, Ian Lance Taylor wrote: > > On Mon, Dec 24, 2018

Re: [go-nuts] Re: if/switch statements as expressions

2018-12-21 Thread Mark Volkmann
tatements. How would that negatively impact the language, in a way >> that can't already be reproduced? >> > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving em

Re: [go-nuts] pointer dereference optimization in loops

2018-11-30 Thread Mark Volkmann
loop iteration? On Fri, Nov 30, 2018 at 11:36 AM Jan Mercl <0xj...@gmail.com> wrote: > > On Fri, Nov 30, 2018 at 6:16 PM Mark Volkmann > wrote: > > > Will the Go compiler optimize the pointer dereference so it doesn't > happen in every loop iteration? If not,

[go-nuts] pointer dereference optimization in loops

2018-11-30 Thread Mark Volkmann
? myValue := *myPtr for _, v := range values { fmt.Printf("%v %v\n", myValue, v) } -- R. Mark Volkmann Object Computing, Inc. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

[go-nuts] pass interface

2018-12-09 Thread Mark Volkmann
Is it possible to pass an interface to a function in Go? I don’t want to pass a value whose type implements the interface, I want to pass the interface. -- R. Mark Volkmann Object Computing, Inc. -- You received this message because you are subscribed to the Google Groups "golang-nuts&q

[go-nuts] getting a reflect.Type for a type

2018-12-05 Thread Mark Volkmann
is this: myThingType := reflect.TypeOf(new(MyThing)).Elem() I seems odd that I have to create one with new, getting a pointer to it, and then ask for the type of the thing in points to (with Elem) in order to get what I need. -- R. Mark Volkmann Object Computing, Inc. -- You received this message

Re: [go-nuts] go language sensitive editor?

2018-11-20 Thread Mark Volkmann
oogle Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- R. Mark Volkmann Object Comput

Re: [go-nuts] When to use panic?

2019-01-03 Thread Mark Volkmann
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. > For more options, visit https://groups.google.com/

Re: [go-nuts] Re: pass interface

2018-12-10 Thread Mark Volkmann
; > > > понедельник, 10 декабря 2018 г., 5:05:12 UTC+3 пользователь Robert Engels > написал: >> >> I mean reflect.Type not a type that is an interface. >> >> On Dec 9, 2018, at 6:53 PM, Space A. wrote: >> >> Of course. When you "pass a value whose type

[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

[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 but mer

[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

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

2019-05-29 Thread Mark Bauermeister
\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 default, the parser simp

[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

[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] Extend map with another map

2019-05-03 Thread Mark Bauermeister
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 more people abo

[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

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-24 Thread Mark Volkmann
> > For those who don't want to follow those links this is the code from the > first URL above: > > lc_unicodeliterals = quote=='u' ? 1 : quote=='U' ? 0 : !!(ast.locale.set & > AST_LC_unicodeliterals); > > -- > Kurtis Rader > Caretaker of the exceptional canines Jun

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

2019-04-24 Thread Mark Bauermeister
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 experimenting with G

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-24 Thread Mark Volkmann
ted ternaries. R. Mark Volkmann Object Computing, Inc. > On Apr 24, 2019, at 8:58 AM, Jan Mercl <0xj...@gmail.com> wrote: > >> On Wed, Apr 24, 2019 at 3:48 PM L Godioleskky wrote: >> >> The lack of a Go ternary operator is at odds with Go's major theme of clean >

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-24 Thread Mark Volkmann
gt; > Ian >>> >>> -- >> 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...@googlegroup

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

2019-04-25 Thread Mark Bauermeister
n reverse bind "com.facebook.react.bridge.ReactContextBaseJavaModule" on the Go side directly, so I can call "getReactApplicationContext()" directly from the Go side rather than pass the context in from Java. I know there's "-classpath" but how does it actually work for external Java libraries? On

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-25 Thread Mark Volkmann
ly be confused by operators related to channels. If you allow people to use pointers, will they use pointers to pointers to pointers to pointers? On Thu, Apr 25, 2019 at 9:19 AM Sam Whited wrote: > On Wed, Apr 24, 2019, at 14:08, Mark Volkmann wrote: > > Are there really developers that

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-24 Thread Mark Volkmann
> On Apr 24, 2019, at 6:22 AM, Robert Engels wrote: > > Though to the ops point, not sure why Go doesn’t have the ternary operator - > which is pretty ubiquitous. The idea of adding the ternary operator to Go has been debated many times. It’s clear that those in charge have a strong

[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

[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

Re: [go-nuts] I know you cannot kill a goroutine, but ...

2019-08-10 Thread Mark Baldridge
I think I can handle the deadly embrace problem. The locks distribute into "slots" based upon inode%slotCount. Just information irrelevant to the observation. At the moment, I use RWMutex to protect each lock table slot since it was more like previous thoughts on this subject. However, I plan to

Re: [go-nuts] Standard library ETag/Last-Modified conditional request logic and best practices?

2019-08-06 Thread mark . mcdx
Thanks Devon! So just to clarify our request flow is: Client > CDN > Go Reverse Proxy > Origin Our Go Reverse Proxy has historically been responsible for adding caching headers (e.g. Cache-Control and Surrogate-Control) when the origins have failed to do so (as a way to ensure things are

[go-nuts] Standard library ETag/Last-Modified conditional request logic and best practices?

2019-08-06 Thread mark . mcdx
ator (e.g. would a simple hash function generating a digest of the URL path + response body suffice)? Thanks for any help/insights/opinions y'all can share with me. Kind regards, Mark -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.

[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

Re: [go-nuts] Cgo fixed length array woes

2020-01-29 Thread mark mellar
Thanks Ian! My C's a bit rusty, I'd expected I'd have to explicitly allocate some memory for rLimits, similar to askedHosts, turns out that isn't required after all and your suggestion of setting element by element is working like a charm! Thanks again, Mark On Tuesday, January 28, 2020

Re: [go-nuts] JSON: Having trouble parsing map keys with dots like {"foo.bar":"baz"}

2020-01-28 Thread Mark Hansen
} > d := json.NewDecoder(strings.NewReader(`{"baz.bar": "hello", "qux": > "hi"}`)) > err := d.Decode(f) > if err != nil { > t.Fatalf("json decoding failed: %v", err) > } > if f.Qux != "hi" { > t.Fatalf("Expected

[go-nuts] Cgo fixed length array woes

2020-01-28 Thread mark mellar
Hi Folks, I'm having some trouble instantiating a C struct from a 3rd party API. I'm not sure if this is more a C question or a Go question, details in the code below, any help would be much appreciated! M // This non-compiling example demonstrates an issue I'm having integrating a 3rd party

  1   2   >