Re: [go-nuts] Is "When in doubt, use a pointer receiver" misleading advice?

2024-10-09 Thread Ken Lee
Hi Oliver is the link already available? Would like to learn more about this On Tuesday 14 November 2023 at 7:23:44 am UTC+8 Oliver Lowe wrote: > > I'd be curious to hear thoughts on this topic. > > There was a fun talk at GopherConAU just a few days ago: "What's > The Point? A Guide To Using Poin

Re: [go-nuts] Using structs, pointers, and maps

2024-10-09 Thread Ken Lee
>>>> Many places and books I've read generally say: If a function needs to >>>>> update a variable, or if an argument is so large that we want to avoid >>>>> copying it, we should pass the pointer. Same for methods (pointer >>>>> receiver

[go-nuts] Re: Using structs, pointers, and maps

2024-10-07 Thread Ken Lee
--- There is a consideration to make, though: historically it has been considered bad form in Go to give a type a mix of value and pointer receivers in methods without a very specific reason for doing so. --- Is this still the case now? As in 2024. On Sunday 13 January 2013 at 7:03:29 am UTC+8

[go-nuts] Re: Go 1.22 Release Candidate 1 is released

2023-12-24 Thread John David Lee
This is in the section titled "Why are yield functions limited to at most two arguments?" On Sunday, December 24, 2023 at 5:43:23 PM UTC+1 John David Lee wrote: > Hello. > > In the rangefunc experiment document > <https://go.dev/wiki/RangefuncExperiment> the iter

[go-nuts] Re: Go 1.22 Release Candidate 1 is released

2023-12-24 Thread John David Lee
Hello. In the rangefunc experiment document the iter package is said to export the following: type Seq[V any] func(yield func(V) bool) bool type Seq2[K, V any] func(yield func(K, V) bool) bool But after installing tip, it looks like the iter package e

[go-nuts] Re: CGO error : cannot use f ( type func(_Ctype_int, **_Ctype_char) _Ctype_int) as *[0]byte value in argument

2023-11-21 Thread Tzu-Yu Lee
feeling that if you provide some more details about what you are trying to achieve, people here might be able to help you get a simpler solution in Go. Tzu-Yu ulis lee 在 2023年11月22日 星期三上午11:28:20 [UTC+8] 的信中寫道: > *Hi, all* > > It's been a month since I started Golang. > But I w

[go-nuts] CGO error : cannot use f ( type func(_Ctype_int, **_Ctype_char) _Ctype_int) as *[0]byte value in argument

2023-11-21 Thread ulis lee
*Hi, all* It's been a month since I started Golang. But I was in a difficult situation. I need your help. *C code* int reopen (const char *fn, time_t check_interval_sec, int (*callback_func) (int num_entry, char **entry), int retry); *Go code* func _Open(fileName string, intervalSec int, f

[go-nuts] CGo error : Cannot use f (type func func(_Ctype_int, **_Ctype_char) _Ctype_int) as *[0]byte value in argument

2023-11-21 Thread ulis lee
Hi all, *C code* int reopen (const char *fn, time_t check_interval_sec, int (*callback_func) (int num_entry, char **entry), int retry); *Go code* func _Open(fileName string, intervalSec int, f func(C.int, **C.char) C.int) int { cFileName := C.CString(fileName) defer C.free(unsafe.Poi

[go-nuts] exceeded max scope depth during object resolution

2023-05-23 Thread Johnny Lee
why output this error? Hope that you can help me. [image: 1684849352934.jpg] -- 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

[go-nuts] Re: Some confusion about escape analysis

2022-08-26 Thread Lee Chou
rite_Writev/noescape-4 273751 4267 ns/op >> 0 B/op 0 allocs/op >> PASS >> ok writev3.410s >> >> Is the noescape safe ? >> Is there a better way to avoid the alloc/escape ? >> - >> Best regards

[go-nuts] Some confusion about escape analysis

2022-08-23 Thread Lee Chou
/op BenchmarkWrite_Writev/noescape-4 273751 4267 ns/op 0 B/op 0 allocs/op PASS ok writev3.410s Is the noescape safe ? Is there a better way to avoid the alloc/escape ? - Best regards Lee -- You received this message because you are subscribed to

Re: [go-nuts] defer func running timing

2022-06-26 Thread Lee Chou
Thanks for taking time. It's really big help. I understand what exactly happened. best regards - lee 在2022年6月26日星期日 UTC+8 05:11:29 写道: > Maybe it's clearer if you look at what's happening like this > https://go.dev/play/p/jAia9OPJfbY > > The arguments to defer are

[go-nuts] defer func running timing

2022-06-25 Thread Lee Chou
Hello, https://go.dev/play/p/J1tVplkIrjt why o1.Ref print `2` but p1.Ref print `1` ? why o1.Ref print `2` but o2.NonRef print `3` ? it's so confused. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rec

[go-nuts] Rules/Etiquette for Code Review?

2022-05-13 Thread 'Daniel.L (Byoungchan) Lee' via golang-nuts
I've only recently been involved in the Golang community, but I have experience with other open source projects by Google. (See my work history in WebRTC and Chromium: [1]) I uploaded a CL [2] 5 months ago to add a workaround for exynos CPUs, but I haven't gotten a proper review yet. Are there

[go-nuts] Re: Go 1.18 is released

2022-03-15 Thread Lee Trout
Release notes and docs appear to missing the update to the embed package where one can now use the `all:` prefix https://go-review.googlesource.com/c/go/+/359413/ On Tuesday, March 15, 2022 at 1:58:17 PM UTC-4 Heschi Kreinick wrote: > Hello gophers, > > We just released Go 1.18 > > To find out

Re: [go-nuts] How to get the executable file from LLVM IR generated by gollvm

2021-06-24 Thread cy lee
file (converting it into LLVM IR) and then pass that on to > the back end (along with the IR from compile Go files), but this feature > doesn't currently exist at the moment. > > Thanks, Than > > > > On Thu, Jun 24, 2021 at 10:33 AM cy lee <190121...@gmail.com&g

[go-nuts] How to get the executable file from LLVM IR generated by gollvm

2021-06-24 Thread cy lee
Hi, I get the .ll files from gollvm, and I know there is no way to get executable file by lli, but whether there are other ways can do this? here is the simple go code, *hello.go* *package mainimport "fmt"func main() { * *fmt.Println("hello world") * *}* Using commands as following,

[go-nuts] Re: directory name and module name not same, go tool pprof, list function faild

2020-08-03 Thread Lee Rick
se the combination of "-source_path" and "-trim_path" still not work my project dir tree macbookpro:tejia_analysis fredlee$ pwd /Users/fredlee/Documents/xxx/tool/tejia_analysis macbookpro:tejia_analysis fredlee$ tree util util ├── analysis.go ├── configure.go ├── cron.go ├── job_discount

Re: [go-nuts] Re: Speed up png.Decode

2020-06-26 Thread Lee Armstrong
#x27;s all overhead. If the images are of a particular form of > PNG, maybe a fast path is missing. And so on. > > To get meaningful help for problems like this, the more information you > can provide, the better. > > -rob > > > On Fri, Jun 26, 2020 at 10:59 PM Lee Armst

Re: [go-nuts] Re: Speed up png.Decode

2020-06-26 Thread Lee Armstrong
Thanks, I am already maxing out some servers but wondered if it could be sped up. I will give the bimg package a go! On Friday, June 26, 2020 at 1:55:40 PM UTC+1 ren...@ix.netcom.com wrote: > Just parallelize in the cloud. At a minimum parallelize locally with > multiple Go routines. > > On J

[go-nuts] Re: how to merge different struct to one struct

2019-08-24 Thread Lee Rick
i read your code, and try to write my code, package main import ( "fmt" "reflect" ) type A struct{ Name string } type B struct{ Age int } type C struct{ Address string } func Merge(a interface{}, b interface{})( d interface{}) { aType := reflect.TypeOf(a) if aType.Kind() != reflect.Struct { pan

Re: [go-nuts] how to merge different struct to one struct

2019-08-24 Thread Lee Rick
1:25:24,burak serdar写道: > > On Fri, Aug 23, 2019 at 11:11 PM Lee Rick > wrote: > > > > it's not my need, hope other methods > > What is your need? What are the types of the variables d1, d2, d3 in > your example? > > > > > 在 2019年8月24日星期六 UTC+8上午

Re: [go-nuts] how to merge different struct to one struct

2019-08-24 Thread Lee Rick
29:03,Jan Mercl写道: > > On Sat, Aug 24, 2019 at 5:25 AM Lee Rick > > wrote: > > > > i want to do > > type A struct{ Name string} > > type B struct{Age int} > > type C struct{Address string} > > > > a, b, c := A{}, B{},C{} > > have

Re: [go-nuts] how to merge different struct to one struct

2019-08-24 Thread Lee Rick
1:25:01,Kurtis Rader写道: > > On Fri, Aug 23, 2019 at 10:11 PM Lee Rick > wrote: > >> it's not my need, hope other methods >> > > Then you need to explain why that answer is not satisfactory and otherwise > better explain your requirements. In your hypothe

Re: [go-nuts] how to merge different struct to one struct

2019-08-23 Thread Lee Rick
it's not my need, hope other methods 在 2019年8月24日星期六 UTC+8上午11:43:32,burak serdar写道: > > On Fri, Aug 23, 2019 at 9:25 PM Lee Rick > > wrote: > > > > i want to do > > type A struct{ Name string} > > type B struct{Age int} > > type C struct{

[go-nuts] how to merge different struct to one struct

2019-08-23 Thread Lee Rick
i want to do type A struct{ Name string} type B struct{Age int} type C struct{Address string} a, b, c := A{}, B{},C{} have a function d1 := merge(a,b) //d1 like struct{Name string, Age int} d2 := merge(a,c) //d2 like struct{Name string, Address string} d3 := merge(b,c) //d3 like struct{Age int,

[go-nuts] Migrating to modules

2019-06-26 Thread lee
All of my projects at the moment are living under GOPATH/src/me/projectName. Is it possible to migrate to using GoModules and pin (for now) the packages at the versions stored in my GOPATH/src. I am thinking that way the migration to GOMODULES will produce a build no different to the build usin

Re: [go-nuts] Proposal: test in one package can import functions from another package's test

2019-04-09 Thread Nanmu Lee
No, you are right, I really don't. Thanks for your idea. I should consider decoupling those parts, in a somehow nice way. Ben Burwell 於 2019年4月9日 週二 下午8:10 寫道: > On Mon, Apr 08, 2019 at 08:33:44PM -0700, nanmu42 wrote: > > I don't know you, but to me, writing Golang test is a little dreary. > >

Re: [go-nuts] multiple binaries from a single directory with go modules?

2019-01-20 Thread Jinwoo Lee
On Sun, Jan 20, 2019 at 11:20 AM Tycho Andersen wrote: > On Sun, Jan 20, 2019 at 11:18:38AM -0800, Jinwoo Lee wrote: > > It looks like "go build ./cmd/..." works when there's only one directory > > under cmd. When there are multiple directories there, the co

Re: [go-nuts] multiple binaries from a single directory with go modules?

2019-01-20 Thread Jinwoo Lee
On Sun, Jan 20, 2019 at 11:33 AM Jan Mercl <0xj...@gmail.com> wrote: > > > > On Sun, Jan 20, 2019 at 8:22 PM Jinwoo Lee wrote: > > > It looks like "go build ./cmd/..." works when there's only one directory > under cmd. When there are multiple director

Re: [go-nuts] multiple binaries from a single directory with go modules?

2019-01-20 Thread Jinwoo Lee
It looks like "go build ./cmd/..." works when there's only one directory under cmd. When there are multiple directories there, the command doesn't generate any binaries for me. I would just do $ go build ./cmd/foo $ go build ./cmd/bar They create binaries in the current directory so you don't ev

[go-nuts] [ANNOUNCE] Moving "etcd" to its own GitHub org

2018-08-06 Thread Gyuho Lee
Hello Go community, We are moving all etcd projects (including coreos/bbolt ) to github.com/etcd-io. For example, github.com/coreos/etcd will be transferred to github.com/etcd-io/etcd , on *August 27,

Re: [go-nuts] Why does the parallel version of a program runs slower?

2018-04-16 Thread Lee Painton
Also, as Rob Pike has stressed in the past, concurrency is not parallelism. Concurrency is a design principle that enables parallelism, but goroutines are concurrency constructs and do not automatically run in parallel. On Monday, April 16, 2018 at 12:47:18 PM UTC-4, andrey mirtchovski wrote:

[go-nuts] Re: Good Cyclomatic Complexity Number for Go

2018-04-13 Thread Lee Painton
>From McCabe's paper on the topic: http://www.literateprogramming.com/mccabe.pdf These results have been used in an operationalenvironrnent by advising project members to limit their software modules by cyclomatic complexity instead of physical size. The particular upper bound that has been use

Re: [go-nuts] Re: Anyway to print the exact cql query being executed against db

2018-04-11 Thread Lee Painton
No problem. Let me know how it works out, I'm going to try it myself sometime next week. On Wed, Apr 11, 2018 at 11:42 AM, Raju wrote: > Thanks, Lee. I will give it a try > > -Raju > > > On Wednesday, April 11, 2018 at 8:39:57 AM UTC-7, Lee Painton wrote: >> >

[go-nuts] Re: Anyway to print the exact cql query being executed against db

2018-04-11 Thread Lee Painton
I have not tried this yet, but if you set up a https://godoc.org/github.com/gocql/gocql#QueryObserver on your session I believe you can get exhaustive metrics including the executed statement. On Wednesday, April 11, 2018 at 12:42:28 AM UTC-4, Raju wrote: > > By the way, I am using gocql package

[go-nuts] Re: After one goroutine completed, does the thread its binded will be destroyed?

2018-04-10 Thread Pelon Lee
Thanks you! I'll see that code. 在 2018年4月10日星期二 UTC+8上午7:32:51,Keith Randall写道: > > Tamás is right. In the case you show, M1 will pick up G2 and work on it. > In general, the M (OS thread) finds another goroutine to run, and if it > can't find one it parks itself until more goroutines show up

[go-nuts] After one goroutine completed, does the thread its binded will be destroyed?

2018-04-09 Thread Pelon Lee
Such as above image. After G1 completed, does the M1 will bind with another goroutine or destroyed? If M1 isn't destroyed, what will it do? If I don't describe clear

Re: [go-nuts] Re: go get -u golang.org/x/net does not work as documented

2018-04-04 Thread Lee Painton
Dobler wrote: > Just to make sure: go get golang.org/x/net works, it does > download all for golang.org/x/net and the message is > just an information. > > V. > > On Thursday, 5 April 2018 04:21:15 UTC+2, Lee Painton wrote: > >> Trying the listed command returns: >

[go-nuts] go get -u golang.org/x/net does not work as documented

2018-04-04 Thread Lee Painton
Trying the listed command returns: package golang.org/x/net: no Go files in /Users/lpainton/go/src/golang.org/x/net Workaround is trivial, but the documentation on https://github.com/golang/net is wrong -- You received this message because you are subscribed to the Google Groups "golang-nuts

[go-nuts] Re: best practices of client middleware

2018-03-06 Thread Sangjin Lee
I offered a PR on alice (which is a middleware library for the handlers) that does that. It's essentially an application of the same pattern. We're getting a lot of mileage for this. https://github.com/justinas/alice/pull/40 On Tuesday, March 6, 2018 at 6:41:53 AM UTC-8, Eyal Posener wrote: > >

[go-nuts] [ANN] etcd v3.3.0

2018-02-01 Thread Gyuho Lee
Hi Go users! We've just released etcd v3.3.0 with blog post . etcd is consistent distributed key-value store, mainly used as a separate coordination service. It's written in Go and uses gRPC for it

[go-nuts] Upcoming Go protobuf release

2018-01-29 Thread lee
Very nice! Do the speed improvements also benefit Proto2? -- 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 opti

[go-nuts] Re: Map with multiple "indexes"

2018-01-10 Thread lee
Perfect thank you! On Wednesday, January 10, 2018 at 2:58:34 PM UTC, Lee Armstrong wrote: > > I'm trying to come up with a data structure that I can search for map > values quickly without having to iterate an entire (and large) map to find > a value. > > Essentially I h

[go-nuts] dependency repo internal mirroring/hosting

2018-01-10 Thread Sangjin Lee
What do folks do in terms of managing/vetting dependencies and also hosting them internally? In other language ecosystems, there are tools such as Nexus or Artifactory that work as caching mirrors for binary dependencies. That way, a company or a team can have a stronger control/governance on d

Re: [go-nuts] Map with multiple "indexes"

2018-01-10 Thread lee
Of course! Thank you! I mocked up a full working example here: https://play.golang.org/p/OUtbbAbbUF1 Any idea though how I would keep deletions in sync though? On Wednesday, January 10, 2018 at 3:24:37 PM UTC, Burak Serdar wrote: > > On Wed, Jan 10, 2018 at 7:57 AM, > > wrote: > > I'm tryin

[go-nuts] Map with multiple "indexes"

2018-01-10 Thread lee
I'm trying to come up with a data structure that I can search for map values quickly without having to iterate an entire (and large) map to find a value. Essentially I have a map that contains lots of data and the key is the primary identifier where most of the lookups go to. This is very quic

[go-nuts] How to send multiple responses (file upload progress) to the client?

2018-01-05 Thread jason . saeho . lee
I've set up a GoLang post request handler that uploads a file to Google Cloud Storage. Now I'd like to figure out how I can send the upload progress info back to the client before the whole thing finishes. Through lots of searching, I've created a custom PassThru struct that prints the progres

Re: [go-nuts] Re: golang for AI

2017-12-24 Thread Lee Rick
working in the symbolic AI field though (ontologies, > > constraint solving and that stuff), not machine learning. > > > > Le vendredi 22 décembre 2017 07:33:04 UTC+1, Lee Rick a écrit : > >> > >> hi, > >>Artificial intelligence is a big trend, and i

[go-nuts] Re: golang for AI

2017-12-24 Thread Lee Rick
lang a lot, so I would tend to > say yes. We're working in the symbolic AI field though (ontologies, > constraint solving and that stuff), not machine learning. > > Le vendredi 22 décembre 2017 07:33:04 UTC+1, Lee Rick a écrit : >> >> hi, >>Artificial intelli

[go-nuts] golang for AI

2017-12-21 Thread Lee Rick
hi, Artificial intelligence is a big trend, and i want to know whether or not to consider golang playing a role in artificial intelligence? Whether to consider developing some basic artificial intelligence package with support package, use just as python. -- You received this message bec

[go-nuts] forwarding http request and response

2017-12-20 Thread Lee Rick
hi, when http server receive a request A, create a new http request B with A, do B, get response respB, create a new http respA with respB how to do "create a new http request B with A" and " create a new http respA with respB" with io.copy method, and reset url,params, hosts etc.

[go-nuts] Re: understanding memory profile

2017-12-07 Thread Sangjin Lee
It is actually with the latest (1.9.2). I'll file an issue. Thanks. On Tuesday, December 5, 2017 at 1:51:07 PM UTC-8, Dave Cheney wrote: > > Can you please check if this is happening with the current version of Go > and if so raise a bug, https://golang.org/issue/new. > > Thanks > -- You rec

[go-nuts] Re: understanding memory profile

2017-12-05 Thread Sangjin Lee
Mystery solved. It turns out it was coming from bytes.NewBuffer which was being invoked in the method I listed. Somehow that was attributed to the import line for bytes rather than the line of invocation. On Tuesday, December 5, 2017 at 10:51:33 AM UTC-8, Dave Cheney wrote: > > No idea. Which ve

[go-nuts] Re: understanding memory profile

2017-12-05 Thread Sangjin Lee
ecember 2017 12:09:54 UTC+11, Sangjin Lee wrote: >> >> A couple of questions on understanding go pprof's memory profile... >> >> When I list a certain function (with --alloc_objects), I see an >> allocation number associated with an import line mysteriously. I am pr

[go-nuts] understanding memory profile

2017-12-04 Thread Sangjin Lee
A couple of questions on understanding go pprof's memory profile... When I list a certain function (with --alloc_objects), I see an allocation number associated with an import line mysteriously. I am pretty certain I can rule out any source line offset. For example, (pprof) list foo Total: 5348

[go-nuts] http.Transport: separating the connection pooling aspect

2017-10-27 Thread Sangjin Lee
We enjoy using http.Transport as it gives us a real solid HTTP client functionality and faithful protocol implementation. The connection pooling/management is also bundled into http.Transport. That's the part I'd like to discuss. The http.Transport connection management takes a stance on a few

Re: [go-nuts] accept4: too many open files;

2017-10-18 Thread lee
In the end the fix seemed to be implementing some timeouts. I found a good guide here... https://blog.cloudflare.com/the-complete-guide-to-golang-net-http-timeouts/ On Tuesday, October 17, 2017 at 10:01:17 PM UTC+1, Tamás Gulácsi wrote: > > Yes. -- You received this message because you are su

Re: [go-nuts] accept4: too many open files;

2017-10-17 Thread lee
This is 1.9.1 and I had not thought of switching to http2 although do need to maintain the 1.1 for older clients. The closing of the body could explain it though which I thought was automatic on a return from the handlers? Do I need to explicitly call that in the handlers?? -- You received t

[go-nuts] accept4: too many open files;

2017-10-17 Thread lee
I have the following code which was working fine in test but in live I am getting 500 errors reported to the clients with multiple lines of 2017/10/17 15:44:52 http: Accept error: accept tcp [::]:9090: accept4: too many open files; retrying in 1s 2017/10/17 15:44:53 http: Accept error: accept t

[go-nuts] Re: Speeding up a concurrent "simple" web server

2017-10-12 Thread lee
That is good to know thanks. Just shows how different it is! On Thursday, October 12, 2017 at 1:03:37 PM UTC+1, Slawomir Pryczek wrote: > > AB is using HTTP/1.0, so it isn't able to do keepalives and it may be the > case that you're really benchmarking your TCP stack, instead of your > webserve

[go-nuts] Re: Speeding up a concurrent "simple" web server

2017-10-11 Thread lee
Thanks Dave, I just used "hey" (I didn't realise that ab was quite so bad!), it looks much better! Summary: Total: 36.1492 secs Slowest: 0.3418 secs Fastest: 0.0002 secs Average: 0.0349 secs Requests/sec: 2766.3147 Total data: 459420 bytes Size/request: 45942 bytes Res

[go-nuts] Re: context cancellation flake

2017-09-17 Thread Steven Lee
> > Cheers, > silviu > > On Saturday, 16 September 2017 16:16:05 UTC-4, Steven Lee wrote: >> >> I guess thats plausible >> >> Ive tried to find the code in the library that sets the body if a context >> is cancelled but cant, I understand how to

[go-nuts] Re: context cancellation flake

2017-09-16 Thread Steven Lee
I guess thats plausible Ive tried to find the code in the library that sets the body if a context is cancelled but cant, I understand how to fix the code just struggling to understand the mechanics and especially why it flakes :( -- You received this message because you are subscribed to the G

[go-nuts] Re: context cancellation flake

2017-09-16 Thread Steven Lee
Does calling the cancel func on a context that is attached to a http.Request change the contents of the body to context cancellation? On Friday, 15 September 2017 18:15:25 UTC+1, Steven Lee wrote: > > Hello, > > I was wondering if anyone could help me with understanding the beh

Re: [go-nuts] Re: bufio.Writer and timeouts

2017-09-14 Thread Sangjin Lee
Hmm maybe I misunderstood your use case. I thought you were basically setting a fixed write duration via SetWriteDeadline() before each Write() call, in which case the same treatment probably should be done for Flush(). Sangjin On Thu, Sep 14, 2017 at 3:33 PM, Juliusz Chroboczek wrote: > > Is

[go-nuts] Re: bufio.Writer and timeouts

2017-09-11 Thread Sangjin Lee
Is extending the deadline right before flushing an option? If your deadline is based on a relative duration, you could apply the same delay on Flush() too because Flush() may incur write, no? On Saturday, September 9, 2017 at 8:17:24 AM UTC-7, Juliusz Chroboczek wrote: > > > bufio.Writer is abo

[go-nuts] fast infoset encoding handler lib in go?

2017-07-18 Thread Sangjin Lee
Is there a fast infoset encoding handler in go out there that can transform it to and from a more textual (e.g. xml) format? I'm referring to the fast infoset format that is used for some (old style) SOAP communication (see https://en.wikipedia.org/wiki/Fast_Infoset). Google search doesn't turn

[go-nuts] golang and openembedded integration

2017-07-17 Thread Lee Nipper
bitbake the image pulling in the go binary programs already built. Have others taken any similar approach for oe and golang build environments ? Any comments about related oe and go integration ? TIA, Lee -- You received this message because you are subscribed to the Google Groups "gola

Re: [go-nuts] golang call c++ api by swig

2017-06-22 Thread Lee Rick
uble >(int,int) instead. gocv_core.i:280: Warning 516: Overloaded method cv::Mat::at< double >(int,int,int) const ignored, gocv_core.i:280: Warning 516: using cv::Mat::at< double >(int,int,int) instead. cp /Users/fredlee/Documents/开发/go/workspace/src/github.com/lazywei/go-

[go-nuts] golang call c++ api by swig

2017-06-22 Thread Lee Rick
hi,guys I wanna wrap opencv2.4.x library to my project by swig, how to do it? anyone can give me a demo ? hope to reply. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving email

[go-nuts] Re: Which Go client for ElasticSearch?

2017-06-02 Thread Lee Rick
i choose https://github.com/olivere/elastic, it works fine. 在 2015年11月5日星期四 UTC+8上午8:21:29,Peter Kleiweg写道: > > The website of ElasticSearch lists three Go clients: > > https://github.com/mattbaird/elastigo > > https://github.com/belogik/goes > > https://github.com/olivere/elastic > > Does anyone

Re: [go-nuts] Re: Large GC pauses with large map

2017-04-21 Thread Lee Armstrong
Yes it is sorted thank you and it has been a super useful discussion. I had no idea the gravity of calling runtime.GC() and it was a bit of a rabbit hole to get to the bottom of that too as it's not in my code. Appreciate all the replies! Lee On Fri, 21 Apr 2017 at 22:12, wrote:

[go-nuts] Re: template Funcs with ParseFile and Execute

2017-03-27 Thread Lee McLoughlin
Perhaps I'm missing something in the documentation but I think this shows something odd happening when the name in New() and the first filename in ParseFiles() do not match: package main import ( "fmt" "html/template" "log" "os" ) // x.tpl contains just one line

[go-nuts] template Funcs with ParseFile and Execute

2017-03-26 Thread Lee McLoughlin
Try changing the call to New to name the template the same as the first parameter to ParseFiles t, _ := template.New(templates.BASE).Funcs(funcMap).ParseFiles(templates.BASE, templates.NOTIFICATIONS, templates.TICKER, templateName) There is something odd about how ParseFiles works if the name i

Re: [go-nuts] Re: Go -> C++ transpiler idea: Miracle child or horrible abomination?

2017-03-25 Thread Lee Nipper
> it might considerably lower the bar for adopting Go I think Go as a language and the tooling make the bar quite low already. With a small time investment it becomes a very productive language for most developers. Choosing a project which makes sense to completely write in Go, and sharing tha

[go-nuts] Re: Golang http reverse proxy in production

2017-03-22 Thread lee
Strangely we just tried deploying a really simple one but with large-ish POST payloads. For some reason the number of requests/s would never match what would hit the nginx servers directly without the Go proxy. wrk & ab profiles were able to cope but as soon as any real world traffic hit the

[go-nuts] errors.New("...") vs package level error vars

2017-02-24 Thread lee . hambley
1.9 to normalize this, so that all errors in the stdlib are handled the same way that net/http handles them, as top level package vars? Cheers, Lee -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and sto

Re: [go-nuts] Panic when highly concurrent MySQL queries

2017-02-16 Thread lee
Ah thanks I had not seen this and replacing it with a non prepared version and some manual sql statement generation fixed the problem. Thank you! On Thursday, February 16, 2017 at 6:22:27 PM UTC, Justin Israel wrote: > > > > On Fri, Feb 17, 2017, 6:48 AM > wrote: > >> I have a channel that recei

[go-nuts] Panic when highly concurrent MySQL queries

2017-02-16 Thread lee
I have a channel that receives a lot of data that needs to be stored into MySQL. After a short period of time I get the following... Error 1461: Can't create more than max_prepared_stmt_count statements (current value: 16382) panic: runtime error: invalid memory address or nil pointer dereferen

Re: [go-nuts] Re: Tracking down logic lock

2017-01-26 Thread lee
Thanks all, I don't use defer in a lot of the places to optimise and minimise the lock time. I suppose looking at those points is probably the safest place to start! On Thursday, January 26, 2017 at 8:07:41 PM UTC, Dave Cheney wrote: > > Start with the basics like go vet which will spot a lock

Re: [go-nuts] Re: Tracking down logic lock

2017-01-26 Thread lee
a current lock. On Thursday, January 26, 2017 at 8:16:28 AM UTC, Konstantin Khomoutov wrote: > > On Thu, 26 Jan 2017 07:51:11 + > Lee Armstrong > wrote: > > > > Send HUP (kill -HUP pid or pressing Ctrl+\ on the terminal), when > > > the program is loc

[go-nuts] Re: Tracking down logic lock

2017-01-25 Thread Lee Armstrong
Thanks, I just had a look and it is very similar to the output of http://127.0.0.1/debug/pprof/goroutine?debug=2 which I can already get to and I can’t see where the lock is left open! On Wed, Jan 25, 2017 at 9:17 PM Tamás Gulácsi wrote: > 2017. január 25., szerda 19:09:36 UTC+1 időpontban l...@

[go-nuts] Tracking down logic lock

2017-01-25 Thread lee
I seem to have an issue with logic in my code as from time to time it will totally lock up the application and doing a dump of the goroutines shows that they are all in the semacquire state. Is there any way without littering the console with logs to determine what had left the lock open at all

Re: [go-nuts] Deadlocking on channels

2017-01-21 Thread lee
also comparing the "same" packet received at different locations anything over a 5 second difference is no good. Weirdly the same "id" can actually occur every 2 seconds which is why I keep the worker around. Some will stay around for 20-30 seconds actually without exiting

Re: [go-nuts] Deadlocking on channels

2017-01-21 Thread lee
I just uploaded a working example to https://play.golang.org/p/88zT7hBLeD It is a long running process so will need running locally on a machine as the playground kills it. Hopefully this will help get to the bottom of it! Lee On Saturday, January 21, 2017 at 8:24:04 AM UTC, l

Re: [go-nuts] Deadlocking on channels

2017-01-21 Thread lee
p and lock that with sync.RWMutex and whether that may help? Lee On Saturday, January 21, 2017 at 3:01:08 AM UTC, Alex Bucataru wrote: > > Actually, a buffered channel alone is not enough... > > A more robust solution is to move the shutdown branch in jobDispatcher > into a

Re: [go-nuts] Deadlocking on channels

2017-01-20 Thread lee
Yeah I did try with it enabled and it sees nothing. I use it all the time, it's great!! Thing is I can see the race condition in the code, just trying to work out how to avoid it! On Friday, January 20, 2017 at 10:09:05 PM UTC, Val wrote: > > Did you try with the race detector enabled? What wa

Re: [go-nuts] Deadlocking on channels

2017-01-20 Thread lee
Perfect thanks! That is really useful! Well it confirms that it is blocked on the `channel <- msg` line. It is kind of a race condition but one that I don't think will be detected by the detector! On Friday, January 20, 2017 at 6:28:33 PM UTC, Shawn Milochik wrote: > > Use pprof: https://golan

[go-nuts] Deadlocking on channels

2017-01-20 Thread lee
Bearing in mind this sort of parallelism seems to work for the amount of data coming through is there a way to make this work? Thanks in advance! Lee var MessageQueue = make(chan *trackingPacket_v1, 5000) func init() { go jobDispatcher(MessageQueue)} func addMessage(trackingPacket *trac

[go-nuts] Re: Network error handle

2016-12-10 Thread Lee McLoughlin
On a Dial error conn will be nil. Remove the call to conn.Close() On Saturday, 10 December 2016 23:28:36 UTC, Stannis Kozlov wrote: > > I'm trying to write simple port scanner and using "net" to check port > availability: > func sock() { > conn, err := net.Dial("tcp", "192.168.0.1:9991") > if

[go-nuts] Re: cockroachdb install with the homebrew option on Mac OS X El Capitan

2016-07-13 Thread Young Lee
My bad, Well, turns out that our company is using a thirdparty filtering service and apparently is blocking access to the url https://honnef.co/go/unused?go-get=1 , :( - Young On Saturday, April 2, 2016 at 6:55:14 PM UTC-7, Young Lee wrote: > > Hi, > > I saw the cockroachdb beta

Re: [go-nuts] Compiling very old version of Golang...

2016-07-05 Thread Mike Lee
s showed up when there was enough of a library to make one > worth writing, and went away as soon as was feasible, when the go tool > showed up (as was always the plan). > > -rob > > > On Mon, Jul 4, 2016 at 8:32 PM, Mike Lee > > wrote: > >

[go-nuts] Compiling very old version of Golang...

2016-07-04 Thread Mike Lee
Hello, For this question please refer to commit 0cafb9ea3d3d34627e8f492ccafa6ba9b633a213 of the Go repository. This is a very early version of Go (2008). I was just curious as to how it looked at the start. I don't have any experience in compilers/language design, can someone tell me how they