Re: [go-nuts] Golang slow performance inside for loop MySQL Queries

2020-10-21 Thread Bill
Hello, I created the sql to fetch all info in one call instead of multiple calls per each row. One thing I noticed about golang is that when I ping my Remote DB from localhost (running in vscode) I get ping -> 1.573826274s. So I think this is the reason that all my calls to db are delayed. Hav

[go-nuts] maptype questions

2020-06-29 Thread Bill Morgan
for this code: m := make(map[int]int, 9) I think the compiler creates a maptype that is stored at type.*+60480(SB) that it uses for the call to runtime.makemap: m := make(map[int]int, 9) 0x10d0b81 488d05f8ec LEAQ type.*+60480(SB), AX 0x10d0b88 48890424 MOVQ AX, 0(SP) 0x10d0b8c 48c74

[go-nuts] who is mike?

2020-06-28 Thread Bill Morgan
who is mike wrt this commit? commit bc0b4f0d2a610059afb95ef0360704714815187d Author: Ken Thompson Date: Thu Nov 13 10:35:44 2008 -0800 mike's map code R=r OCL=19146 CL=19146 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group

[go-nuts] text template and white space suppression

2020-06-28 Thread Bill Nixon
I am trying to do some creative formatting using text template and wanted to see if there might be a better approach than what I implemented. I have an array of structs, where each element has a Project and Task. The array is sorted by Project. type DisplayTask struct { Project string Task str

[go-nuts] Re: [runtime] gostring question

2020-06-23 Thread Bill Morgan
On Tuesday, June 23, 2020 at 7:32:56 PM UTC-5, Bill Morgan wrote: > > I'm a C programmer so maybe this is a dumb question but, why does this > code in runtime/gostring.go allocate (rawstring) then copy data (memmove) > instead of just making the stringStruct.str point at

[go-nuts] [runtime] gostring question

2020-06-23 Thread Bill Morgan
I'm a C programmer so maybe this is a dumb question but, why does this code in runtime/gostring.go allocate (rawstring) then copy data (memmove) instead of just making the stringStruct.str point at the incoming data? i.e. copy the pointer instead of allocating+copying data. func gostring(p *by

[go-nuts] Microsoft Graph for Go

2019-12-08 Thread Bill Nixon
but I am considering writing a OneDrive Sync client. Thanks, Bill -- 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.

[go-nuts] Re: golang tool for splitting long lines

2019-11-24 Thread Bill Nixon
I agree json.MarshalIndent is great. However, be aware that json.MarshalIndent will not output private (lowercase) fields of the struct. On Monday, November 18, 2019 at 3:29:28 AM UTC-6, anderso...@blacklane.com wrote: > > Hi Sankar, > > Not really, a easy trick is to use json.MarshalIndent. It

[go-nuts] cgo build error

2019-11-03 Thread Bill Anderson
*I met a problem* *I compiled a native ELF binary running on android arm7 on Ubuntu.* export GOOS=android export GOARCH=arm export GOARM=7 export CGO_ENABLED=1 export CGO_CFLAGS="-g -O2 --sysroot=/mnt/d/sdk/android/android-ndk-r14b-linux/android-24/arch-arm" export CGO_LDFLAGS="--sysroot=/mnt/d/

Re: [go-nuts] Re: Question about casting

2018-02-18 Thread Bill Wood
ype definition creates a new, distinct type with the same underlying > type <https://golang.org/ref/spec#Types> and operations as the given > type, and binds an identifier to it." > > myInt is a distinct type from int, but it has the same underlying type and > is therefore "num

Re: [go-nuts] Re: Question about casting

2018-02-18 Thread Bill Wood
. On Sunday, February 18, 2018 at 2:16:17 PM UTC-5, Jan Mercl wrote: > > On Sun, Feb 18, 2018 at 8:06 PM Bill Wood > > wrote: > > > I thought that the plus operator would return an int, not a myInt. > > expr1 + expr2 works iff types of expr1 and expr2 are the same and th

[go-nuts] Re: Question about casting

2018-02-18 Thread Bill Wood
s interface{} = res; // no cast needed, see above > return ires > } > > Hope this clarifies the typing. > > Aside: if you come from C++, aliasing interface{} as any might feel > comfortable, but that's not a good Go style. > > > On Saturday, February 17, 2018 at

[go-nuts] Question about casting

2018-02-17 Thread Bill Wood
HI, Go newbie here... not sure if this is a dumb question or not :) I have a simple program: package main import "fmt" type any interface{} type myInt int func plus(a, b any) any { return a.(myInt) + b.(myInt) } func main() { s := plus(myInt(3), myInt(2)) fmt.Printf("%v, %T\n", s, s) } Outp

[go-nuts] Re: [ANN] ztdns: A simple DNS server for ZeroTier Virtual Networks

2018-01-11 Thread bill
I just expanded my use of ZeroTier and this project would be great but I can't quite get it to work on Windows. It runs, connects to ZeroTier and imports all of the machines. But it doesn't appear to be responding to DNS requests. I can't telnet to it on port 53 either (not a firewall issue.) A

[go-nuts] Re: Is this bad concurrency?

2017-08-21 Thread bill . warner
ain: not 1, return > > > On Friday, August 18, 2017 at 11:13:36 AM UTC-7, bill@talentinc.com > wrote: >> >> Hi, >> >> https://play.golang.org/p/lR6_mxSjtb >> >> I have two long running things to do, I'd like to do them in parallel, >&g

[go-nuts] Re: Is this bad concurrency?

2017-08-18 Thread bill . warner
Thanks to both for replying. Both pieces of advice cover the use case of waiting for all goroutines to complete before exiting. I have the opposite problem. I want to end all goroutines if I exit. Is there anything in the sync package for that? On Friday, August 18, 2017 at 2:40:39 PM UTC-4, Ta

[go-nuts] Is this bad concurrency?

2017-08-18 Thread bill . warner
Hi, https://play.golang.org/p/lR6_mxSjtb I have two long running things to do, I'd like to do them in parallel, then sync up at the end. I've written it as a function which gets one thing done, and which backgrounds the second thing with a goroutine. Thing one has a lot of reasons to exit earl

Re: [go-nuts] Re: Casting []byte to []uint64

2017-02-27 Thread Bill Katz
Ah, of course, silly me conflating alignment with allocation size. Thanks for the suggestion. Best, Bill On Monday, February 27, 2017 at 3:35:32 PM UTC-5, Ian Lance Taylor wrote: > > On Mon, Feb 27, 2017 at 11:57 AM, Bill Katz > wrote: > > I thought that's handled by th

[go-nuts] Re: Casting []byte to []uint64

2017-02-27 Thread Bill Katz
.Data is aligned with 8 bytes as well. > > On Sunday, February 26, 2017 at 2:54:00 PM UTC-8, Bill Katz wrote: >> >> Hi, >> >> We'd like to do a zero-copy conversion of []byte to []uint64 where the >> underlying memory for the byte slice is properly aligned for

[go-nuts] Casting []byte to []uint64

2017-02-26 Thread Bill Katz
Hi, We'd like to do a zero-copy conversion of []byte to []uint64 where the underlying memory for the byte slice is properly aligned for N uint64 values. After looking at (6) in the unsafe package documentation , I'm wondering if the code below is valid

[go-nuts] Re: install go compiler without sudo right

2016-12-22 Thread bill . hathaway
Do you want to use Go version 1.4 specifically for some reason? If not, I'd recommend going with the most recent stable release (1.7.4). Besides the git clone/build process Dave Cheney mentioned, you can download a binary build of the compiler/tools for Linux at: https://storage.googleapis.co

Re: [go-nuts] Re: type assertion: Can I DRY this up?

2016-11-02 Thread Bill Warner
at are out of range, handle paths that are longer than the struct is deep, etc. But what i've shared runs against the sample json. On Tuesday, November 1, 2016 at 1:04:21 PM UTC-4, wwa...@gmail.com wrote: https://play.golang.org/p/LhOTUuTVqA On Tuesday, November 1, 2016 at 12:50:09 PM UTC

Re: [go-nuts] Re: type assertion: Can I DRY this up?

2016-11-02 Thread Bill Warner
e, handle paths that are longer than the struct is deep, etc. But what i've shared runs against the sample json. On Tuesday, November 1, 2016 at 1:04:21 PM UTC-4, wwa...@gmail.com wrote: https://play.golang.org/p/LhOTUuTVqA On Tuesday, November 1, 2016 at 12:50:09 PM UTC-4, Bill Warner wro

[go-nuts] Re: type assertion: Can I DRY this up?

2016-11-01 Thread Bill Warner
Yes it's just a fragment. Let me clean it up a bit, then I'll share a playground link. On 11/1/16 12:47 PM, Volker Dobler wrote: Am Dienstag, 1. November 2016 02:07:49 UTC+1 schrieb wwa...@gmail.com: Hello all, I'm new to Go, and I have a question about identifying types as they'r