[go-nuts] msgbus - a simple message bus / pubsub server/library

2017-06-07 Thread prologic
Hey all, I got a bit bored on some recent long haul flights and put together msgbus: https://github.com/prologic/msgbus I have plans to turn this into something more robust and to use it in another project I'm working on, but for now here is what I have so far. Feedback / critique welcome!

Re: [go-nuts] Segmentation fault (core dump) on process exit after calling golang function from C shared object

2017-06-07 Thread Ian Lance Taylor
On Wed, Jun 7, 2017 at 4:56 PM, wrote: > > I'm building a .so on linux (64bit ubuntu) that is used in a closed-source > application. Build steps: > > go build -buildmode=c-archive gfeeder.go > cc -c -fPIC -pthread cfeeder.c > cc -c -fPIC -pthread feeder.c > ld -shared -o

[go-nuts] Segmentation fault (core dump) on process exit after calling golang function from C shared object

2017-06-07 Thread jslowery
I'm building a .so on linux (64bit ubuntu) that is used in a closed-source application. Build steps: go build -buildmode=c-archive gfeeder.go cc -c -fPIC -pthread cfeeder.c cc -c -fPIC -pthread feeder.c ld -shared -o feeder.so feeder.o cfeeder.o gfeeder.a $ cat gfeeder.go package main import

[go-nuts] Re: How to turn on conditional logging?

2017-06-07 Thread Val
Hello Chun In your code, myLog.enable is not a constant (I mean, not a go constant) so I can understand that the compiler doesn't "optimize away" all the calls to (*myLog).Println. However, I recently tried to achieve the same with a constant (toggled only by the developer before compilation)

[go-nuts] decwar clone

2017-06-07 Thread Harris Newman
For the last year I've been working on a Decwar clone in golang, I really need alpha testers to tune the game and make suggestions. It features most of the instruction set of the original Decwar, a 79x79 universe, but, with some syntax changes support for nearly unlimited users. It uses a

[go-nuts] How to turn on conditional logging?

2017-06-07 Thread Chun Zhang
Hi, All, I have some piece of code with very high cpu usage, logging is actually pretty cpu intensive, so I tried to turn it off as follows, type myLog struct { *log.Logger enable bool } func (l *myLog) Println(v ...interface{}) { if l.enable == true {

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

2017-06-07 Thread Marvin Renich
* Tong Sun [170607 15:53]: > So, Here is the update version. > > 1. https://play.golang.org/p/txOIO1riwd > 2. https://play.golang.org/p/_Qk9n0mZPM > > The two version only differ on line 26 & 29. However, the second one will > get the following while trying to do

[go-nuts] Save file handle into struct

2017-06-07 Thread Tong Sun
Hi again, I think I have found of a bug of go & gofmt. On Tuesday, June 6, 2017 at 5:47:23 PM UTC-4, Tong Sun wrote: > > > 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

Re: [go-nuts] log package implementation question

2017-06-07 Thread Ian Lance Taylor
On Wed, Jun 7, 2017 at 11:12 AM, wrote: > > I was perusing the code for the standard log package (src/log/log.go - The > Go Programming Language) and was wondering why the formatHeader method (line > 92) takes a pointer to byte slice since the only call to this method line >

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

2017-06-07 Thread Tieson Molly
I had the same line of thinking regarding avoiding an ORM. I settled on using sqlx for my project. On Friday, June 2, 2017 at 8:55:12 AM UTC-4, brylant wrote: > > > I've been trying hard (well.. as much as I can considering my lack of > in-depth go knowledge or - to be perfectly honest - lack

[go-nuts] log package implementation question

2017-06-07 Thread hanisch
I was perusing the code for the standard log package (src/log/log.go - The Go Programming Language ) and was wondering why the formatHeader method (line 92) takes a pointer to byte slice since the only call to this method line (163) calls it

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

2017-06-07 Thread 'Axel Wagner' via golang-nuts
On Wed, Jun 7, 2017 at 7:22 PM, Sankar P wrote: > > 2017-06-06 22:52 GMT+05:30 Axel Wagner : > >> 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

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

2017-06-07 Thread Jim Smart
On Tuesday, June 6, 2017 at 6:22:28 PM UTC+1, Axel Wagner wrote: > > 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. > > > I've not done

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

2017-06-07 Thread Sankar P
2017-06-06 22:52 GMT+05:30 Axel Wagner : > 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. a) I created an

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

2017-06-07 Thread Alain Mellan
Sure, this is what I did. I'm working on Windows with MinGW. sayhello.go: // package name: hello package main import "C" import "fmt" //export SayHello func SayHello() { fmt.Printf("Hello!\n") fmt.Scanln() fmt.Printf("Goodbye\n") } func main() { // We need the main function to make possible

[go-nuts] [ANN] aah web framework for Go, v0.6 Released

2017-06-07 Thread Jeevanandam M.
*Website:* https://aahframework.org *Documentation:* https://docs.aahframework.org *Release Notes:* v0.6 https://docs.aahframework.org/release-notes.html Please give it a try aah web framework and share your inputs. Your feedback is very valuable. Thanks. Cheers, Jeeva -- You received this

Re: [go-nuts] Re: Ignore stale read errors from the race detector

2017-06-07 Thread Ian Lance Taylor
On Tue, Jun 6, 2017 at 7:48 PM, wrote: > > "there is no guarantee that the write to done will ever > be observed by main", i am wondering why the write to done will ever > be observed by main in detail? I'm sorry, I don't understand the question. The program in question,

Re: [go-nuts] Re: Ignore stale read errors from the race detector

2017-06-07 Thread haofxpro
"there is no guarantee that the write to done will ever be observed by main", i am wondering why the write to done will ever be observed by main in detail? On Thursday, February 25, 2016 at 8:07:29 AM UTC+8, Nigel Tao wrote: > > On Tue, Feb 23, 2016 at 7:46 AM, Damian Gryski

[go-nuts] Re: strange stack trace when panic

2017-06-07 Thread binlaniua
awsome 在 2017年6月7日星期三 UTC+8下午4:25:35,Dave Cheney写道: > > Try building your program with -gcflags="-l" to disable inlining. If that > restores the stacktrace, then it's inlining. The good news is this should > be fixed with Go 1.9 > > On Wednesday, 7 June 2017 16:37:26 UTC+10, winlin wrote: >> >>

[go-nuts] trying to learn xml unmarshaling

2017-06-07 Thread Tamás Gulácsi
Where is SEVERITY tag closed? The text you copied here is not an XML. -- 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] trying to learn xml unmarshaling

2017-06-07 Thread rob
Hi. I am trying to unmarshal the xml file I get from my bank. It seems that the unmarshal routine cannot deal w/ the nested html fields. sample.qfx OFXHEADER:100 DATA:OFXSGML VERSION:102 SECURITY:NONE ENCODING:USASCII CHARSET:1252 COMPRESSION:NONE OLDFILEUID:NONE NEWFILEUID:NONE

[go-nuts] Re: strange stack trace when panic

2017-06-07 Thread winlin
When I run with -gcflags="-l", it works~ winlin$ go run -gcflags="-l" t.go panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x104bf82] goroutine 1 [running]: main.causedPanic() /Users/winlin/git/t.go:13

[go-nuts] Re: strange stack trace when panic

2017-06-07 Thread Dave Cheney
Try building your program with -gcflags="-l" to disable inlining. If that restores the stacktrace, then it's inlining. The good news is this should be fixed with Go 1.9 On Wednesday, 7 June 2017 16:37:26 UTC+10, winlin wrote: > > Hi, I'm confused by the stack trace when panic, and I have

[go-nuts] strange stack trace when panic

2017-06-07 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()