[go-nuts] strange stack trace when panic

2017-06-06 Thread winlin
Hi, I'm confused by the stack trace when panic, and I have searched both in history topics and google. If I use panic, the stack is fine, code is https://play.golang.org/p/Yb7fYW9ro3 , output is: panic: Panic from user goroutine 1 [running]: main.causedPanic() /tmp/sandbox078566511/ma

Re: [go-nuts] Re: Guidance on exposing functionality

2017-06-06 Thread Michael Jones
sometimes you can write the simple one in terms of the advanced one. when you can do that, it makes them better and also educational. On Tue, Jun 6, 2017 at 7:09 PM, peterGo wrote: > M2, > > The Go strconv package (https://golang.org/pkg/strconv/) contains the > simple forms Atoi and Itoa and th

[go-nuts] Re: mixed C / Go debugging

2017-06-06 Thread brainman
It would be useful if you provide complete instructions of what you did, so we could at least be able to reproduce it here. Including complete source code and description of environment and tools you use. Thank you. Alex -- You received this message because you are subscribed to the Google Gro

[go-nuts] Re: letsencrypt, localhost and autocert

2017-06-06 Thread winlin
There is a library base on lego and letsencrypt project: https://github.com/ossrs/go-oryx-lib/blob/master/https/example_test.go#L33 And there is a server as an example for that library: https://github.com/ossrs/go-oryx/blob/develop/httpx-static/main.go#L174 On Wednesday, June 7, 2017 at 1:07:1

[go-nuts] mixed C / Go debugging

2017-06-06 Thread Alain Mellan
Hi, I need to have a Go application wrapped in a DLL with a thin C layer so that I can load the .dll (I'm on Windows) from a C/C++ application. What are my options for debugging the Go code? When I load my app from gdb, it seems the Go code is a black box, and dlv does not seem to be able to a

[go-nuts] Re: In-memory secondary index

2017-06-06 Thread James Pettyjohn
Thanks Dragos, I had looked at that one earlier but I was hoping for something that was more implicit to a struct definition. Something like: type StructIndex struct{} func NewStructIndex([]Interface{}) *StructIndex{} func (si *StructIndex) Get(k string, v interface{}) []interface{} Implementat

Re: [go-nuts] Save file handle into struct

2017-06-06 Thread Tong Sun
On Tue, Jun 6, 2017 at 5:50 PM, Sebastien Binet wrote: > like so: > https://play.golang.org/p/s-7h25c5jW > duh. Thanks! -- 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

[go-nuts] Re: Guidance on exposing functionality

2017-06-06 Thread peterGo
M2, The Go strconv package (https://golang.org/pkg/strconv/) contains the simple forms Atoi and Itoa and the complex forms ParseInt and FormatInt. In the documentation for each function refer to the alternate form. Peter On Tuesday, June 6, 2017 at 3:56:43 PM UTC-4, M2 wrote: > > I need to exp

[go-nuts] Re: Guidance on exposing functionality

2017-06-06 Thread M2
Thanks for taking the time to respond. This is how I was thinking also. I am trying to gather what is the most common approach in Go community to avoid "surprising" my users. If anyone has an opinion please feel free to chime in. Thanks again On Tuesday, June 6, 2017 at 1:43:57 PM UTC-7, Matt

Re: [go-nuts] Save file handle into struct

2017-06-06 Thread Sebastien Binet
like so: https://play.golang.org/p/s-7h25c5jW On Tue, Jun 6, 2017 at 11:47 PM, Tong Sun wrote: > Hi, > > How to save the file handle into struct? > > So in this file, > https://play.golang.org/p/SWnJ4TZyTu > > If I change line 34 "ft.f" to just "f", it will at least pass gofmt. Else, > I'll get

[go-nuts] Save file handle into struct

2017-06-06 Thread Tong Sun
Hi, How to save the file handle into struct? So in this file, https://play.golang.org/p/SWnJ4TZyTu If I change line 34 "ft.f" to just "f", it will at least pass gofmt. Else, I'll get 34:5: expected identifier on left side of := However, what if I want to save the opened file handle into st

[go-nuts] Re: Guidance on exposing functionality

2017-06-06 Thread Matt Layher
Approach number one is the correct way, IMO. That's what I've always done: https://godoc.org/github.com/mdlayher/netlink#Conn.Execute. - Matt On Tuesday, June 6, 2017 at 3:56:43 PM UTC-4, M2 wrote: > > I need to expose 2 ways of doing the same thing. > > - The first way is very simple, always d

[go-nuts] Guidance on exposing functionality

2017-06-06 Thread M2
I need to expose 2 ways of doing the same thing. - The first way is very simple, always does the right thing and is impossible to use improperly. It is expected to be used by the majority of users. - The second one can be used improperly but offers more flexibility. It is expected to be used by

[go-nuts] Re: Is there any golang package available for building mongodb query from plain logic expression string or URL?

2017-06-06 Thread Ray Yang
Thanks Nathan. It has builder part but I need both parser and builder. It looks that I have to build the wheel or at least part of it. On Monday, June 5, 2017 at 11:16:36 PM UTC-7, Nathan Kerr wrote: > > I haven't tried it, but https://github.com/jhsx/qm might be useful. -- You received this me

Re: [go-nuts] letsencrypt, localhost and autocert

2017-06-06 Thread Andy Balholm
What it boils down to is that your server tries to get a certificate for whatever name is in the URL. But Let’s Encrypt won’t issue a certificate for localhost, for various reasons—not the least of which is that a certificate for localhost makes as much sense as having a photo ID that says “Me”

Re: [go-nuts] letsencrypt, localhost and autocert

2017-06-06 Thread 'Axel Wagner' via golang-nuts
tl;dr: You need a) a publicly routed IP address (either IPv4 or IPv6 is fine), b) a publicly resolvable domain that points to that IP address and c) actually point your client (browser) to that domain. Long explanation: The HTTP client will use SNI to tell the server the domain it needs a cert fo

[go-nuts] Re: Golang, SQL and ORM avoidance techniques

2017-06-06 Thread Ren Thraysk
On Tuesday, 6 June 2017 13:46:58 UTC+1, venturestre...@gmail.com wrote: > > On a complete tangent, are you calling a stored procedure there? I thought > the database/sql package didn't support MySQL stored procedures yet? > Haven't encountered a serious issue, as yet. Obviously output paramete

[go-nuts] letsencrypt, localhost and autocert

2017-06-06 Thread Sankar
Hi I saw the tweet https://twitter.com/mholt6/status/848704744474292224 and decided to try out the code log.Fatal(http.Serve(autocert.NewListener("mydomain.com "), handler)) but when I try to visit: https://localhost:443, I get an error on the server console as: server n

Re: [go-nuts] can't build golang.org/x/benchmarks package using gccgo

2017-06-06 Thread Ian Lance Taylor
On Tue, Jun 6, 2017 at 3:46 AM, Joost Shao wrote: > > i know that gccgo vendor not support. To the best of my knowledge, gccgo does support vendoring. It was fixed by https://golang.org/cl/39590 which was committed to GCC in SVN revision 246864 which is included in the GCC 7 release. Which vers

[go-nuts] Re: Golang, SQL and ORM avoidance techniques

2017-06-06 Thread venturestreamtemporary
On a complete tangent, are you calling a stored procedure there? I thought the database/sql package didn't support MySQL stored procedures yet? On Monday, June 5, 2017 at 5:43:33 PM UTC+1, Ren Thraysk wrote: > > > Wrote something similar recently. > > One difference is that I moved the rows.Scan

[go-nuts] Sharing a gorilla/mux router across packages

2017-06-06 Thread nickcorin
I'm having some issues with implementing a slight MVC design with gorilla/mux. The layout of the modules is as follows: main.go-- controllers base.controller.go example.controller.go-- models base.model.go example.controller.go All the files in controllers is in the controlle

Re: [go-nuts] can't build golang.org/x/benchmarks package using gccgo

2017-06-06 Thread Joost Shao
hi, thank you , i really know what you mean, cd /home/ubuntu/go/src/github.com/valyala/fasttemplate/vendor/github.com/ valyala/bytebufferpool yes, the compile -x included vendor , thank you again 在 2017年6月6日星期二 UTC+8下午7:08:35,Dave Cheney写道: > > > > On Tuesday, 6 June 2017 20:46:38 UTC+10, Joo

Re: [go-nuts] can't build golang.org/x/benchmarks package using gccgo

2017-06-06 Thread Dave Cheney
On Tuesday, 6 June 2017 20:46:38 UTC+10, Joost Shao wrote: > > > i know that gccgo vendor not support. > > hi, Dave, but even gopath also not supported ? > I don't know what you mean by gopath support, the example you showed had the library inside the projects' vendor directory. > > and what

Re: [go-nuts] can't build golang.org/x/benchmarks package using gccgo

2017-06-06 Thread Joost Shao
which is OK WORK=/tmp/go-buildxxx mkdir -p $WORK/github.com/BurntSushi/toml/_obj/ mkdir -p $WORK/github.com/BurntSushi/ cd /home/ubuntu/go/src/github.com/BurntSushi/toml /usr/bin/gccgo -I $WORK -c -g -m64 -fgo-pkgpath=github.com/BurntSushi/toml -fgo-relative-import-path=_/home/ubuntu/go/src/githu

Re: [go-nuts] can't build golang.org/x/benchmarks package using gccgo

2017-06-06 Thread Joost Shao
i know that gccgo vendor not support. hi, Dave, but even gopath also not supported ? and what's the road map? 在 2017年6月6日星期二 UTC+8下午6:38:32,Dave Cheney写道: > > I'd say gccgo does not support vendoring. > > On Tue, 6 Jun 2017, 20:35 Joost Shao > > wrote: > >> >> >> 在 2017年6月6日星期二 UTC+8下午6:35:2

Re: [go-nuts] can't build golang.org/x/benchmarks package using gccgo

2017-06-06 Thread Dave Cheney
I'd say gccgo does not support vendoring. On Tue, 6 Jun 2017, 20:35 Joost Shao wrote: > > > 在 2017年6月6日星期二 UTC+8下午6:35:23,Joost Shao写道: > >> >> >> 在 2017年6月6日星期二 UTC+8下午6:34:02,Joost Shao写道: >>> >>> thank you first, i have been stuck by gccgo-7.x for gopath and govendor >>> many days. >>> >>> go

Re: [go-nuts] can't build golang.org/x/benchmarks package using gccgo

2017-06-06 Thread Joost Shao
在 2017年6月6日星期二 UTC+8下午6:35:23,Joost Shao写道: > > > > 在 2017年6月6日星期二 UTC+8下午6:34:02,Joost Shao写道: >> >> thank you first, i have been stuck by gccgo-7.x for gopath and govendor >> many days. >> >> gopath is ok, like below. >> >> ubuntu@ubuntu-zesty:~/go/src/github.com/valyala$ tree >> . >> └── fast

Re: [go-nuts] can't build golang.org/x/benchmarks package using gccgo

2017-06-06 Thread Joost Shao
在 2017年6月6日星期二 UTC+8下午6:34:02,Joost Shao写道: > > thank you first, i have been stuck by gccgo-7.x for gopath and govendor > many days. > > gopath is ok, like below. > > ubuntu@ubuntu-zesty:~/go/src/github.com/valyala$ tree > . > └── fasttemplate > ├── example_test.go > ├── LICENSE > ├─

Re: [go-nuts] can't build golang.org/x/benchmarks package using gccgo

2017-06-06 Thread Joost Shao
thank you first, i have been stuck by gccgo-7.x for gopath and govendor many days. gopath is ok, like below. ubuntu@ubuntu-zesty:~/go/src/github.com/valyala$ tree . └── fasttemplate ├── example_test.go ├── LICENSE ├── README.md ├── template.go ├── template_test.go ├── tem

[go-nuts] add note to google groups golang-nuts introduction text

2017-06-06 Thread fgergo
If I understand correctly https://groups.google.com/forum/#!forum/golang-nuts is usually the top search result for "go mailing list" or similar queries. I suggest adding something like this near the 4 listed rules: "Please note: this is a google groups interface to a mailing list, you can't delete

Re: [go-nuts] can't build golang.org/x/benchmarks package using gccgo

2017-06-06 Thread Dave Cheney
Does the missing package exist in your gopath? On Tue, 6 Jun 2017, 17:24 Joost Shao wrote: > what about now ? i used gccgo-7 to compile framework echo, but failed . > > error is blow: > > ubuntu@ubuntu-zesty:~$ gccgo-7 -v > Using built-in specs. > COLLECT_GCC=gccgo-7 > COLLECT_LTO_WRAPPER=/usr/l

Re: [go-nuts] can't build golang.org/x/benchmarks package using gccgo

2017-06-06 Thread Joost Shao
what about now ? i used gccgo-7 to compile framework echo, but failed . error is blow: ubuntu@ubuntu-zesty:~$ gccgo-7 -v Using built-in specs. COLLECT_GCC=gccgo-7 COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_6