Re: [go-nuts] Compiling Go plugins with playground/NACL/GAE-like isolation

2017-05-17 Thread voidlogic
For some use cases I am sure this kind of integration would be just fine. But if functions within plugins are called often enough the overhead difference between calling a function in a dynamically linked library (.so) and communicating via a UNIX socket will quickly become non-trivial. Even if

Re: [go-nuts] beginner seeks peer review

2017-05-17 Thread kbfastcat
Thanks much, will review this, and incorporate changes... On Wednesday, May 17, 2017 at 12:56:59 AM UTC-7, Lutz Horn wrote: > > Hi, > > the more I work with Go the more I like it. Reading code written by > other people, even by beginners, is straight forward. > > > https://github.com/kbfastcat/

[go-nuts] Re: nested template question

2017-05-17 Thread Tieson Molly
thanks Billie, I will check it out On Wednesday, May 17, 2017 at 1:56:46 PM UTC-4, Billie H Cleek wrote: > > Ty, > > The block template can satisfy your need: > https://godoc.org/text/template#example-Template--Block > > On Wednesday, May 17, 2017 at 4:55:28 AM UTC-7, Tieson Molly wrote: >> >> I

Re: [go-nuts] Compiling Go plugins with playground/NACL/GAE-like isolation

2017-05-17 Thread Aldrin Leal
go-plugin wouldn't work? github.com/hashicorp/go-plugin -- -- Aldrin Leal, / http://about.me/aldrinleal On Wed, May 17, 2017 at 7:05 PM, voidlogic wrote: > Hey Everyone, > > I'm working on a project to allow other teams within my company to submit > plugins that are executing as optional eve

[go-nuts] Compiling Go plugins with playground/NACL/GAE-like isolation

2017-05-17 Thread voidlogic
Hey Everyone, I'm working on a project to allow other teams within my company to submit plugins that are executing as optional event handlers within my application. We currently support Lua but with the addition of Go plugin support we would like to support Go as well (our app is written in Go

Re: [go-nuts] x/term: go-keycodes

2017-05-17 Thread Nigel Tao
On Sun, May 14, 2017 at 6:02 PM, anatoly techtonik wrote: > On Fri, May 12, 2017 at 7:54 AM, Nigel Tao wrote: >> On Fri, May 12, 2017 at 3:11 AM, anatoly techtonik >> wrote: >>> I am new to Go and I need a cross-platform value for keyboard key codes to >>> make sure I can react to user key pres

[go-nuts] Golang map is getting corrupted with Memory mapped files

2017-05-17 Thread Tamás Gulácsi
I don't really understand what are you doing. You serialize with gob.Encode, but does NOT deserialize, just use the encoded bytes as the backing memory of an unitialized map. This won't work. Either deserialize with gob.Decode, or use your own custom data structure, which can be backed by memory

[go-nuts] Re: nested template question

2017-05-17 Thread bhcleek
Ty, The block template can satisfy your need: https://godoc.org/text/template#example-Template--Block On Wednesday, May 17, 2017 at 4:55:28 AM UTC-7, Tieson Molly wrote: > > Is there a way to defined a template name as a fallback if one does not > exist? > > Say you have a nested template in yo

Re: [go-nuts] Golang map is getting corrupted with Memory mapped files

2017-05-17 Thread chaitanya reddy
Thanks Jan for the reply. So is there any way I can make this program to work? On Wednesday, May 17, 2017 at 6:15:12 AM UTC-7, Jan Mercl wrote: > > On Wed, May 17, 2017 at 2:49 PM chaitanya reddy > wrote: > > Maps must be initialized before mutating them, which the program does not > do. Howeve

Re: [go-nuts] Realizing SSD random read IOPS

2017-05-17 Thread Ian Lance Taylor
On Wed, May 17, 2017 at 12:29 AM, Manish Rai Jain wrote: > >> libaio sounds good on paper, but at least on GNU/Linux it's all in user >> space. > > I see. That makes sense. Reading a bit more, Linux native I/O sounds like it > does exactly what we expect, i.e. save OS threads, and push this to ker

Re: [go-nuts] Why no return statement for *timerCtx in func parentCancelCtx(context.go)

2017-05-17 Thread Ian Davis
On Wed, 17 May 2017, at 01:40 PM, Guohua Ouyang wrote: > I was confusing when I read the lines #L279-#L280 > https://github.com/golang/go/blob/master/src/context/context.go#L279 it will loop with the new value of parent > -- > You received this message because you are subscribed to the Google

Re: [go-nuts] Re: http: TLS handshake error from :: EOF

2017-05-17 Thread James Hartig
I've posted a more detailed explanation of this to the net-dev mailing list: https://groups.google.com/a/chromium.org/forum/#!topic/net-dev/IsYHz3hNlNU What we're seeing is clients making 2 back-to-back TCP connections to port 443 but only ever sending Client Hello (and continuing TLS handshake)

Re: [go-nuts] Golang map is getting corrupted with Memory mapped files

2017-05-17 Thread Jan Mercl
On Wed, May 17, 2017 at 2:49 PM chaitanya reddy wrote: Maps must be initialized before mutating them, which the program does not do. However, when initializing a map it's not possible to chose where the map instance will be allocated neither where the map will acquire memory when needed. -- -j

[go-nuts] Re: [go/loader] write a conf to load faster a program ?

2017-05-17 Thread mhhcbon
Do you think i could take advantage of importer to serialize stdlib, then unserialize it rather than process it every times ? Are those types linked to some sort of unserializable resource that would prevent that to happen ? On Tuesday, May 16, 2017 at 1:43:44 AM UTC+2, mhh...@gmail.com wrote:

Re: [go-nuts] Realizing SSD random read IOPS

2017-05-17 Thread 'David Klempner' via golang-nuts
On May 16, 2017 22:03, "Ian Lance Taylor" wrote: On Tue, May 16, 2017 at 9:26 PM, Manish Rai Jain wrote: >> The runtime will spawn a new thread to replace the one that is blocked. > > Realized that after writing my last mail. And that actually explains some of > the other crashes we saw, about "

[go-nuts] Casbin: an authorization library that supports access control models like ACL, RBAC, ABAC

2017-05-17 Thread Yang Luo
Hi there, casbin (https://github.com/casbin/casbin) is a powerful and efficient open-source access control library for Golang projects. It provides support for enforcing authorization based on various models. By far, the access control models supported by casb

[go-nuts] Golang map is getting corrupted with Memory mapped files

2017-05-17 Thread chaitanya reddy
Hi I was trying to write persistent map using mmap. But my map is getting corrupted by mmaps. I think I am using them wrongly. I need your advise. Thanks in advance. package main import ( "bytes" "encoding/gob" "fmt" "os" "syscall" "unsafe" )

[go-nuts] Why no return statement for *timerCtx in func parentCancelCtx(context.go)

2017-05-17 Thread Guohua Ouyang
I was confusing when I read the lines #L279-#L280 https://github.com/golang/go/blob/master/src/context/context.go#L279 -- 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

[go-nuts] nested template question

2017-05-17 Thread Tieson Molly
Is there a way to defined a template name as a fallback if one does not exist? Say you have a nested template in your code {{template "javascript" .}} if the template name "javascript" is not defined because you did not include that file during the parsing, is there a way to generate that n

[go-nuts] The zero value of a slice is nil

2017-05-17 Thread mhhcbon
hi At https://blog.golang.org/go-slices-usage-and-internals#TOC_3. It says, > The zero value of a slice is nil. The len and cap functions will both return 0 for a nil slice. Then looked at https://youtu.be/ynoY2xz-F8s?t=10m20s I found the second explanation much better to explain https://

[go-nuts] Re: [ANN] Ugarit

2017-05-17 Thread mhhcbon
hi there, On Tuesday, May 16, 2017 at 12:28:37 PM UTC+2, Luis Furquim wrote: > > > > Em segunda-feira, 15 de maio de 2017 09:30:20 UTC-3, mhh...@gmail.com > escreveu: >> >> On the code itself, >> i suspect you don t know yet about *go fmt*, >> I strongly suggest you to use it, >> just because its

[go-nuts] Re: Stop HTTP Server with Context cancel

2017-05-17 Thread mhhcbon
> Is it OK to use context cancellation for stopping long running functions ? yes, i d say so. About contexts, https://www.youtube.com/watch?v=LSzR0VEraWw https://www.youtube.com/watch?v=8M90t0KvEDY >From scratch, with some mocks to test&try. package main import ( "context" "log"

Re: [go-nuts] beginner seeks peer review

2017-05-17 Thread Lutz Horn
Hi, the more I work with Go the more I like it. Reading code written by other people, even by beginners, is straight forward. https://github.com/kbfastcat/nrmetrics go_vet and the misspell check found some minor issues: https://goreportcard.com/report/github.com/kbfastcat/nrmetrics My obs

Re: [go-nuts] adding context.Context to new code

2017-05-17 Thread Nazri Ramliy
I'm about to embark on doing the same, and my first pit stop is at using the callgraph to generate the caller-callee data but stumbled upon this error while trying out the example given by the "callgraph" command when run without arguments: $ callgraph -format '{{.Caller.Pkg.Object.Path}} -> {{.Ca

Re: [go-nuts] Realizing SSD random read IOPS

2017-05-17 Thread Dave Cheney
Can you post the svg versions of those profiles? Also, I recommend the execution trace profiler for this job, it'll show you a lot of detail about how the runtime is interacting with your program. On Wed, 17 May 2017, 17:29 Manish Rai Jain wrote: > > libaio sounds good on paper, but at least on

Re: [go-nuts] Realizing SSD random read IOPS

2017-05-17 Thread Manish Rai Jain
> libaio sounds good on paper, but at least on GNU/Linux it's all in user space. I see. That makes sense. Reading a bit more, Linux native I/O sounds like it does exactly what we expect, i.e. save OS threads, and push this to kernel: http://man7.org/linux/man-pages/man2/io_submit.2.html But, I sup